[off topic] fallow code removal

Eric Christopher echristo@apple.com
Fri May 5 18:28:00 GMT 2006


>
> Any suggestions, pointers or recommendations for tools, tips and/or
> techniques would be appreciated.

A couple of different ways come to mind:

a) there's the binutils -ffunction-sections -Wl,-gc-sections approach  
where every function is put into it's own section and the total is  
then garbage collected by the linker with extra sections that aren't  
referenced are then deleted.

b) the mechanism the mach-o linker uses which is similar, but since - 
ffunction-sections may overrun the maximum allowed number of  
sections, everything is divided on label boundaries and split into  
"atoms". Any atom not in the direct call graph or without a  
relocation is then deleted in the final linked image.

-eric



More information about the Gcc-help mailing list