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

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Mar 29 21:17:27 GMT 2020


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is a bug in LLVM's lld.

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170116/420892.html

     2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT    1 _binary_t85_c_start
     3: 00000000000002c8     0 NOTYPE  GLOBAL DEFAULT    1 _binary_t85_c_end
     4: 00000000000002c8     0 NOTYPE  GLOBAL DEFAULT  ABS _binary_t85_c_size

You cannot refer to this symbol directly from C code.
What I do in my code is the following top level inline-asm:
#define SIZE_SECTION(section)   \
asm(                            \
".pushsection .rodata\n"        \
".align 8\n"                    \
".global __size_" section "\n"  \
"__size_" section ":\n"         \
".xword .sizeof.." section "\n" \
".popsection\n"                 \
)


More information about the Gcc-bugs mailing list