bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/29655] s390x gas generates PC32DBL instead of PLT32DBL for func


From: krebbel at linux dot ibm.com
Subject: [Bug gas/29655] s390x gas generates PC32DBL instead of PLT32DBL for function call
Date: Mon, 10 Oct 2022 06:39:39 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29655

--- Comment #17 from Andreas Krebbel <krebbel at linux dot ibm.com> ---
I have attached a patch for the testcase in Comment 14. Turns out that we also
have to zero out the symbol value in order to avoid function pointer references
in the main binary to be wired up to the main binary PLT slot.

The patch also helps with my non-pic testcase from Comment 12. However, here it
relies on the @PLT marker on the symbol in the function call. I think with that
we are circling back to Rui's original question from Comment 2.

How should the linker recognize whether a symbol is used only as part of direct
function calls or whether its address is taken? All the linker can look at are
the relocations. Mold currently relies on symbols in direct function calls to
use a PLT32DBL reloc while function pointer references use PC32DBL or R_390_64.
With the attached patch the same will apply to ld.

Clang always adds the @PLT marker and GCC starts doing this with version 12. So
I think we are ok. I would rather not want to backport the GCC patch to older
versions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]