dynamic linker: permit error returns from arch-specific reloc function

the immediate motivation is supporting TLSDESC relocations which
require allocation and thus may fail (unless we pre-allocate), but
this mechanism should also be used for throwing an error on
unsupported or invalid relocation types, and perhaps in certain cases,
for reporting when a relocation is not satisfiable.
This commit is contained in:
Rich Felker 2014-06-16 03:09:07 -04:00
commit bfa09700b9
8 changed files with 16 additions and 8 deletions

View file

@ -9,7 +9,7 @@
#define IS_COPY(x) ((x) == R_SH_COPY)
#define IS_PLT(x) ((x) == R_SH_JMP_SLOT)
static inline void do_single_reloc(
static inline int do_single_reloc(
struct dso *self, unsigned char *base_addr,
size_t *reloc_addr, int type, size_t addend,
Sym *sym, size_t sym_size,
@ -44,4 +44,5 @@ static inline void do_single_reloc(
: self->tls_offset + 8;
break;
}
return 0;
}