[LLVMdev] [PROPOSAL] ELF safe/unsafe sections

Nick Kledzik kledzik at apple.com
Mon Jul 29 09:24:07 PDT 2013


On Jul 25, 2013, at 2:10 PM, Rui Ueyama wrote:
> Is there any reason -ffunction-sections and -fdata-sections wouldn't work? If it'll work, it may be be better to say "if you want to get a better linker output use these options", rather than defining new ELF section.

>From my understanding, -ffunction-sections is a good semantic match.  But it introduces a lot of bloat in the .o file which the linker must process.   

For reference, with mach-o we just added a flag to the overall .o file that says all sections are "safe".  The compiler always generates safe object files (unless there is inline code with non-local labels) and always sets the flag.   Hand written assembly files did not have the flag by default, but savvy assembly programmers can set it.

-Nick
 



More information about the llvm-dev mailing list