diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-01-16 07:00:09 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-01-16 07:02:36 -0800 |
commit | 75a933f39918ce4f4b9481234992895e022787ee (patch) | |
tree | fc7399127a449f992c5b4e5009ab9aec0faa7c30 /bfd/elfxx-x86.c | |
parent | 68b007788a6cc5376708af42bc220f540e8c4b8a (diff) | |
download | gdb-75a933f39918ce4f4b9481234992895e022787ee.zip gdb-75a933f39918ce4f4b9481234992895e022787ee.tar.gz gdb-75a933f39918ce4f4b9481234992895e022787ee.tar.bz2 |
ld/elf/x86: Don't compare IFUNC address in the shared object
On x86, glibc 2.33 starts to issue a fatal error message when calling
IFUNC function defined in the unrelocated executable from a shared
library.
1. Update x86 ELF linker to always convert IFUNC function defined in
position-dependent executable (PDE) to the normal function. GOT in PDE
will be updated by R_*_IRELATIVE at run-time.
2. Update PR ld/23169 tests not to compare function address of external
IFUNC function in the shared object to avoid calling the IFUNC function
defined in the unrelocated executable.
3. Remove pr23169e tests which call the IFUNC function defined in the
unrelocated position-independent executable from a shared library.
bfd/
PR ld/23169
* elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): Don't
check pointer_equality_needed.
ld/
PR ld/23169
* testsuite/ld-ifunc/ifunc.exp: Replace pr23169c.rd with
pr23169a.rd for pr23169c and pr23169f. Remove pr23169e tests.
* testsuite/ld-ifunc/pr23169a.c (foo): Don't compare function
address.
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r-- | bfd/elfxx-x86.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index 8cda8d2..93ad38c 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -1711,8 +1711,7 @@ _bfd_x86_elf_link_fixup_ifunc_symbol (struct bfd_link_info *info, && h->def_regular && h->dynindx != -1 && h->plt.offset != (bfd_vma) -1 - && h->type == STT_GNU_IFUNC - && h->pointer_equality_needed) + && h->type == STT_GNU_IFUNC) { asection *plt_s; bfd_vma plt_offset; |