Summary: | gold IFUNC testsuite failures with GCC 5 | ||
---|---|---|---|
Product: | binutils | Reporter: | H.J. Lu <hjl.tools> |
Component: | gold | Assignee: | Cary Coutant <ccoutant> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | amodra, ian, rafael |
Priority: | P2 | ||
Version: | 2.26 | ||
Target Milestone: | 2.26 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Bug Depends on: | |||
Bug Blocks: | 18521 | ||
Attachments: | A patch |
Description
H.J. Lu
2015-07-06 17:33:17 UTC
This isn't a miscompilation of gold itself, but rather of the testcases. You can prove this quite easily by building gold with gcc-5, running "make check" to reproduce the test failures, then "rm testsuite/script_test_1* testsuite/ifunc*" before running "make check" with an older gcc. I opened PR 18663 to track: FAIL: script_test_1 FAIL: script_test_11 The IFUNC test issue is [hjl@gnu-6 pr18628]$ readelf -r ifuncmod1.so Relocation section '.rela.dyn' at offset 0x390 contains 7 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000001828 000100000006 R_X86_64_GLOB_DAT foo() foo + 0 000000001838 000200000006 R_X86_64_GLOB_DAT foo_hidden() foo_hidden + 0 000000001848 000300000006 R_X86_64_GLOB_DAT foo_protected() foo_protected + 0 000000001818 000400000006 R_X86_64_GLOB_DAT 0000000000001880 global + 0 000000001820 000600000006 R_X86_64_GLOB_DAT 0000000000000000 ret_foo + 0 000000001830 000800000006 R_X86_64_GLOB_DAT 0000000000000000 ret_foo_hidden + 0 000000001840 000a00000006 R_X86_64_GLOB_DAT 0000000000000000 ret_foo_protected + 0 Relocation section '.rela.plt' at offset 0x438 contains 3 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000001868 000100000007 R_X86_64_JUMP_SLO foo() foo + 0 000000001870 000000000025 R_X86_64_IRELATIV 520 000000001878 000000000025 R_X86_64_IRELATIV 550 [hjl@gnu-6 pr18628]$ readelf -s ifuncmod1.so | grep global 4: 0000000000001880 4 OBJECT GLOBAL PROTECTED 12 global 10: 0000000000001880 4 OBJECT GLOBAL PROTECTED 12 global [hjl@gnu-6 pr18628]$ GCC 5 will generate relocation for protected symbol: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 It is undefined to access protected symbol in IFUNC selector function inside a DSO. Created attachment 8434 [details]
A patch
This works for me.
Reopen *** Bug 18521 has been marked as a duplicate of this bug. *** This bug report has analysis and a patch is posted at https://sourceware.org/ml/binutils/2015-07/msg00098.html The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cd78ea777c35c497fcc0f20d162789296dc0a44d commit cd78ea777c35c497fcc0f20d162789296dc0a44d Author: H.J. Lu <hjl.tools@gmail.com> Date: Wed Jul 22 03:35:47 2015 -0700 Mark global with hidden attribute GCC 5 will generate a relocation for protected symbol: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 when compiling for a shared library. It is undefined to access protected symbol in IFUNC selector function inside a shared library. PR gold/18628 * testsuite/ifuncdep2.c (global): Change protected to hidden. * testsuite/ifuncmod1.c (global): Likewise. * testsuite/ifuncmod5.c (global): Likewise. Fixed. |