From bfa09700b927c99cff5263483c1d7a4d1fe766e5 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 16 Jun 2014 03:09:07 -0400 Subject: 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. --- arch/x86_64/reloc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/x86_64/reloc.h') diff --git a/arch/x86_64/reloc.h b/arch/x86_64/reloc.h index 28cf7cc1..30f65614 100644 --- a/arch/x86_64/reloc.h +++ b/arch/x86_64/reloc.h @@ -7,7 +7,7 @@ #define IS_COPY(x) ((x)==R_X86_64_COPY) #define IS_PLT(x) ((x)==R_X86_64_JUMP_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, @@ -43,4 +43,5 @@ static inline void do_single_reloc( : 0 - self->tls_offset) + addend; break; } + return 0; } -- cgit v1.2.1