Check for undefined weak symbols during PLT binding on powerpc64, and do
not attempt to copy NULL function descriptors. This fixes LD_BIND_NOW on powerpc64 after r211706. Reviewed by: kib
This commit is contained in:
parent
89f81c9646
commit
d48dde6f68
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212497
@ -405,8 +405,13 @@ reloc_jmpslots(Obj_Entry *obj)
|
||||
(void *)target, basename(defobj->path));
|
||||
#endif
|
||||
|
||||
reloc_jmpslot(where, target, defobj, obj,
|
||||
(const Elf_Rel *) rela);
|
||||
if (def == &sym_zero) {
|
||||
/* Zero undefined weak symbols */
|
||||
bzero(where, sizeof(struct funcdesc));
|
||||
} else {
|
||||
reloc_jmpslot(where, target, defobj, obj,
|
||||
(const Elf_Rel *) rela);
|
||||
}
|
||||
}
|
||||
|
||||
obj->jmpslots_done = true;
|
||||
|
@ -183,7 +183,7 @@ static Objlist list_main = /* Objects loaded at program startup */
|
||||
static Objlist list_fini = /* Objects needing fini() calls */
|
||||
STAILQ_HEAD_INITIALIZER(list_fini);
|
||||
|
||||
static Elf_Sym sym_zero; /* For resolving undefined weak refs. */
|
||||
Elf_Sym sym_zero; /* For resolving undefined weak refs. */
|
||||
|
||||
#define GDB_STATE(s,m) r_debug.r_state = s; r_debug_state(&r_debug,m);
|
||||
|
||||
|
@ -261,6 +261,7 @@ extern void *xcalloc(size_t);
|
||||
extern void *xmalloc(size_t);
|
||||
extern char *xstrdup(const char *);
|
||||
extern Elf_Addr _GLOBAL_OFFSET_TABLE_[];
|
||||
extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */
|
||||
|
||||
extern void dump_relocations (Obj_Entry *);
|
||||
extern void dump_obj_relocations (Obj_Entry *);
|
||||
|
Loading…
Reference in New Issue
Block a user