From dddc88587a7f48cbb361d9929ec23d790164eef8 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 10 Jul 2023 17:01:00 -0300 Subject: sparc: Fix la_symbind for bind-now (BZ 23734) The sparc ABI has multiple cases on how to handle JMP_SLOT relocations, (sparc_fixup_plt/sparc64_fixup_plt). For BINDNOW, _dl_audit_symbind will be responsible to setup the final relocation value; while for lazy binding _dl_fixup/_dl_profile_fixup will call the audit callback and tail cail elf_machine_fixup_plt (which will call sparc64_fixup_plt). This patch fixes by issuing the SPARC specific routine on bindnow and forwarding the audit value to elf_machine_fixup_plt for lazy resolution. It fixes the la_symbind for bind-now tests on sparc64 and sparcv9: elf/tst-audit24a elf/tst-audit24b elf/tst-audit24c elf/tst-audit24d Checked on sparc64-linux-gnu and sparcv9-linux-gnu. Tested-by: John Paul Adrian Glaubitz --- sysdeps/generic/dl-lookupcfg.h | 2 +- sysdeps/generic/ldsodefs.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/dl-lookupcfg.h b/sysdeps/generic/dl-lookupcfg.h index cc5e9d619b..e4f6358f88 100644 --- a/sysdeps/generic/dl-lookupcfg.h +++ b/sysdeps/generic/dl-lookupcfg.h @@ -27,5 +27,5 @@ #define DL_FIXUP_VALUE_ADDR(value) (value) #define DL_FIXUP_ADDR_VALUE(addr) (addr) #define DL_FIXUP_BINDNOW_ADDR_VALUE(addr) (addr) -#define DL_FIXUP_BINDNOW_RELOC(value, new_value, st_value) \ +#define DL_FIXUP_BINDNOW_RELOC(l, reloc, value, new_value, st_value, lazy) \ (*value) = st_value; diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 8b7e603c87..e8b7359b04 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -1362,8 +1362,8 @@ void _dl_audit_preinit (struct link_map *l); the flags with LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT prior calling la_symbind{32,64}. */ void _dl_audit_symbind (struct link_map *l, struct reloc_result *reloc_result, - const ElfW(Sym) *defsym, DL_FIXUP_VALUE_TYPE *value, - lookup_t result) + const void *reloc, const ElfW(Sym) *defsym, + DL_FIXUP_VALUE_TYPE *value, lookup_t result, bool lazy) attribute_hidden; /* Same as _dl_audit_symbind, but also sets LA_SYMB_DLSYM flag. */ void _dl_audit_symbind_alt (struct link_map *l, const ElfW(Sym) *ref, -- cgit v1.2.3