This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [off topic] fallow code removal



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]