diff --git a/ldso/ldso/arm/dl-sysdep.h b/ldso/ldso/arm/dl-sysdep.h index 2bb0023..be53bd6 100644 --- a/ldso/ldso/arm/dl-sysdep.h +++ b/ldso/ldso/arm/dl-sysdep.h @@ -77,6 +77,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry); ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one of the main executable's symbols, as for a COPY reloc. +#ifdef __FDPIC__ Avoid R_ARM_ABS32 to go through the PLT so that R_ARM_TARGET1 translated to R_ARM_ABS32 doesn't use the PLT: otherwise, this breaks init_array because functions are referenced through the @@ -87,6 +88,13 @@ unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry); || (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32) \ * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) +#else +#define elf_machine_type_class(type) \ + ((((type) == R_ARM_JUMP_SLOT || (type) == R_ARM_TLS_DTPMOD32 \ + || (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32) \ + - ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) +#endf /* __FDPIC__ */ /* Return the link-time address of _DYNAMIC. Conveniently, this is the first element of the GOT. We used to use the PIC register to do this @@ -125,6 +133,7 @@ elf_machine_dynamic (void) extern char __dl_start[] __asm__("_dl_start"); +#ifdef __FDPIC__ /* We must force strings used early in the bootstrap into the data segment. */ #undef SEND_EARLY_STDERR @@ -133,6 +142,7 @@ extern char __dl_start[] __asm__("_dl_start"); #undef INIT_GOT #include "../fdpic/dl-sysdep.h" +#endif /* __FDPIC__ */ /* Return the run-time load address of the shared object. */ static __always_inline Elf32_Addr __attribute__ ((unused))