svn commit: r341513 - head/libexec/rtld-elf/aarch64
Michal Meloun
mmel at FreeBSD.org
Wed Dec 5 10:30:54 UTC 2018
Author: mmel
Date: Wed Dec 5 10:30:53 2018
New Revision: 341513
URL: https://svnweb.freebsd.org/changeset/base/341513
Log:
Tidy up arm64 reloc_jmpslots() implementation.
- don't relocate jump slots multiple times (if LD_BIND_NOW is defined).
- process only R_AARCH64_JUMP_SLOT here, other relocation types are handled
by reloc_plt().
MFC after: 1 week
Modified:
head/libexec/rtld-elf/aarch64/reloc.c
Modified: head/libexec/rtld-elf/aarch64/reloc.c
==============================================================================
--- head/libexec/rtld-elf/aarch64/reloc.c Wed Dec 5 10:23:38 2018 (r341512)
+++ head/libexec/rtld-elf/aarch64/reloc.c Wed Dec 5 10:30:53 2018 (r341513)
@@ -243,8 +243,10 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat
const Elf_Rela *relalim;
const Elf_Rela *rela;
const Elf_Sym *def;
- struct tls_data *tlsdesc;
+ if (obj->jmpslots_done)
+ return (0);
+
relalim = (const Elf_Rela *)((const char *)obj->pltrela +
obj->pltrelasize);
for (rela = obj->pltrela; rela < relalim; rela++) {
@@ -265,20 +267,9 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat
reloc_jmpslot(where, target, defobj, obj,
(const Elf_Rel *)rela);
break;
- case R_AARCH64_TLSDESC:
- if (ELF_R_SYM(rela->r_info) != 0) {
- tlsdesc = (struct tls_data *)where[1];
- if (tlsdesc->index == -1)
- rtld_tlsdesc_handle_locked(tlsdesc,
- SYMLOOK_IN_PLT | flags, lockstate);
- }
- break;
- default:
- _rtld_error("Unknown relocation type %x in jmpslot",
- (unsigned int)ELF_R_TYPE(rela->r_info));
- return (-1);
}
}
+ obj->jmpslots_done = true;
return (0);
}
More information about the svn-src-all
mailing list