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

Reply via email to