[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/23169] IFUNC pointer should be allowed in executable
From: |
i at maskray dot me |
Subject: |
[Bug ld/23169] IFUNC pointer should be allowed in executable |
Date: |
Sun, 17 Jan 2021 00:32:26 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=23169
Fangrui Song <i at maskray dot me> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |i at maskray dot me
--- Comment #8 from Fangrui Song <i at maskray dot me> ---
Can https://sourceware.org/glibc/wiki/GNU_IFUNC to updated to document what is
supported and what isn't supported?
For the https://sourceware.org/bugzilla/show_bug.cgi?id=23169#c0 example, if
you run:
gcc -fpie -g -c -o main.o main.c
gcc -fpie -g -c -o func.o func.c
gcc -g -fPIC -c -o foo.o foo.c
gcc -shared -o libfoo.so foo.o
gcc -pie -o x main.o func.o libfoo.so -Wl,-R,.
Previously, a STT_GNU_IFUNC did not need to be converted to STT_FUNC if there
were only GOT-generating or PLT-generating relocations.
func.o had only a GOT-generating relocation: R_X86_64_REX_GOTPCRELX. func was
STT_GNU_IFUNC.
After the recent GNU ld commit
https://sourceware.org/bugzilla/show_bug.cgi?id=23169#c7
STT_GNU_IFUNC is converted to STT_FUNC regardless of the relocation type.
func is STT_FUNC.
Is the idea that
(1) the main executable is relocated the last.
(2) by making the main executable STT_GNU_IFUNC STT_FUNC, ifunc resolver will
not be called while the main executable is unresolved
(3) How does an ifunc resolver defined in another DSO work? Let the user
ensures DT_NEEDED BFS order or the ld.so itself does topological sorting?
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/23169] IFUNC pointer should be allowed in executable, cvs-commit at gcc dot gnu.org, 2021/01/16
- [Bug ld/23169] IFUNC pointer should be allowed in executable,
i at maskray dot me <=
- [Bug ld/23169] IFUNC pointer should be allowed in executable, hjl.tools at gmail dot com, 2021/01/17
- [Bug ld/23169] IFUNC pointer should be allowed in executable, cvs-commit at gcc dot gnu.org, 2021/01/18
- [Bug ld/23169] IFUNC pointer should be allowed in executable, i at maskray dot me, 2021/01/18
- [Bug ld/23169] IFUNC pointer should be allowed in executable, hjl.tools at gmail dot com, 2021/01/18
- [Bug ld/23169] IFUNC pointer should be allowed in executable, hjl.tools at gmail dot com, 2021/01/18