[PATCH] D40954: [ELF] - Teach LLD to hint about -fdebug-types-section.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 02:09:22 PDT 2018


>Most callers want just the location, so maybe leave a getErrorLocation
>inline helper that returns getErrorPlace(Loc).Loc?
>
>With that the implementation is fine, but is someone really hitting this
>issue?
>
>Cheers,
>Rafael
>

Yes.
We have LLD bug: "lld fails with "relocation R_X86_64_32 out of range" (https://bugs.llvm.org//show_bug.cgi?id=31109).

-fdebug-types-section flag is disabled by default, but it can help to reduce size of output a lot. 
For example one of the best results for llvm binaries for me was:

 "I compared clang binaries to see the difference with and without the linker side optimisation:
1) Clang built with -g has size of 1.7 GB, .debug_info section size is 894.5 Mb.
2) Clang built with -g -fdebug-types-section has size of 1.0 GB.
    .debug_types size is 26.267 MB, .debug_info size is 227.7 MB."

With that .debug_info is significantly reduced in size, so such hint might help to solve the out of range
failure sometimes I believe.

George.




More information about the llvm-commits mailing list