Initially it appeared that the binutils
gold linker was capable of building large -g shared libs, providing a solution for (3) above, however, it turns out that is because of a lack of error checking.
On the other hand it looks like work on (1) and (2) is in available if a bleeding edge toolchain is used, part of the fission dwarf/binutils/gcc work described here:
This fission work was mentioned in discussion of a bugzilla report on this relocation truncation error:
http://sourceware.org/bugzilla/show_bug.cgi?id=15444
An example of the use of this split debug files is:
g++ -gsplit-dwarf -gdwarf-4 -c -o main.o main.cpp
gcc -gsplit-dwarf -gdwarf-4 -c -o d1/t1.o d1/t1.c
g++ -gsplit-dwarf -gdwarf-4 -c -o d2/t2.o d2/t2.cpp
gcc -Wl,--index-gdb main.o d1/t1.o d2/t2.o -o main
where gcc
/g++
are version 4.8, the binutils
trunk (cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
) has been used configured with --enable-gold=default
, and finally using gdb version 7.6 which can read the split debug info.
Joining gcc in the party, the intel (version 16) compiler supports -gsplit-dwarf. The intel compiler documents that binutils-2.24+,gdb-7.6.1+ are required. The clang compiler codebase has some split dwarf support, but I don't know what state that support is in.