Linker issue with long variable names

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

 



We are getting failures to link our application for what appears to be one of the debug sections in the ELF being too big for 32-bit addresses.
The error from the gold linker is hundreds of thousands of copies of the following with different addresses):
    app-main.o(.debug_info+0x2acc): error: relocation overflow: reference to local symbol 3578 in app-main.o
and with the bfd linker:
    app-main.o:(.debug_info+0x7e): relocation truncated to fit: R_X86_64_32 against `.debug_str'
This is compiled using GCC 7.2.1 and ld/ld.gold 2.29 on an x86_64 linux host with the flags "-g -O3 -fuse-ld=gold -Wl,--strip-debug-gdb -Wl,--strip-lto-sections -Wl,--gc-sections -Wl,--no-whole-archive -Wl,--no-add-needed".
When compiled with -g0 the app is 4.3M and with -g1 is 3.6G. The object files for -g are around 5.2G.
We have tried various combinations of flags to try and workaround this issue:
-ggdb
-gdwarf-4
-gdwarf-5
-fdebug-types-section
-feliminate-unused-debug-symbols
-feliminate-unused-debug-types
-fmerge-debug-strings
-m64
-Wl,-m,elf64_x86_64
-Wl,--oformat,elf64_x86_64
-Wl,--compress-debug-sections=zlib
-gz
-g2
There were a couple of changes that were able to finish the link, but they are not workable:
-gsplit-dwarf -Wl,--gdb-index : This is unusable as it consumes 4x the RAM and not many of our machines have 150G to spare.
-g1 : This is unusable as we lose the ability to examine core files generated by the app.
-s : same as above
Do you have any suggestions to workaround this issue?





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux