[Bug target/94391] gcc refers to absolute symbols with R_X86_64_PC32 relocation

yshuiv7 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 30 09:29:26 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94391

--- Comment #11 from Yuxuan Shui <yshuiv7 at gmail dot com> ---
(In reply to Andrew Pinski from comment #8)
> Also it is wrong for a person to assume a normal C variable could be
> SHN_ABS; that is the bug here.  It is a bug in the user code.
> I showed up to fix it by using an top level inline-asm.

Why is this wrong? Is it written down somewhere that a C variable can never be
SHN_ABS, perhaps in the standard, or in the X86-psABI?

If this is wrong, then what is the correct way to access a SHN_ABS symbol? Is
it just no way to do it? If so, what's the purpose of objcopy generating such
symbols?


More information about the Gcc-bugs mailing list