[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE
From: |
amodra at gmail dot com |
Subject: |
[Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE |
Date: |
Tue, 10 Oct 2017 23:14:14 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22269
--- Comment #9 from Alan Modra <amodra at gmail dot com> ---
> Since call is PC relative, this doesn't branch to address 0.
I don't see why this matters. A symbol that resolves to zero without dynamic
relocs in a PIE or shared lib results in an address of zero. If that zero is
in a PC-relative instruction then you get zero relative to the shared library
or PIE base. Typical code for dealing with weakly defined functions like
if (foo)
foo ();
will give you a load of zero (absolute) on the condition, but a relative zero
for the call.
> This doesn't work with
>
> -pie --no-dynamic-linker -z dynamic-undefined-weak
Define "doesn't work". I would have said that combination of options ought to
result in a dynamic reloc for "func" on the original testcase. Which is what
powerpc will do. It may not work in the runtime environment for static PIE,
but that's a different issue. By passing -z dynamic-undefined-weak you asked
for dynamic relocs!
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22269] New: Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/06
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/06
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/06
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/06
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, amodra at gmail dot com, 2017/10/09
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/09
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, amodra at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE,
amodra at gmail dot com <=
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, amodra at gmail dot com, 2017/10/10
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, cvs-commit at gcc dot gnu.org, 2017/10/11
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, hjl.tools at gmail dot com, 2017/10/11
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, cvs-commit at gcc dot gnu.org, 2017/10/12
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, cvs-commit at gcc dot gnu.org, 2017/10/14
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, cvs-commit at gcc dot gnu.org, 2017/10/14
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, cvs-commit at gcc dot gnu.org, 2017/10/14
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, cvs-commit at gcc dot gnu.org, 2017/10/14
- [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE, cvs-commit at gcc dot gnu.org, 2017/10/14