How to selectively remove functions from relocatable ELF object file?

Rajat Jain rajat.noida.india@gmail.com
Tue Mar 7 14:25:00 GMT 2006


Hi,

Does there exist any method to selectively remove some of the
functions from a relocatable ELF object file??

I googled and found that using the options -fdata-sections and
-ffunction-sections, the gcc will place each function / data variable
in a seperate section. And then I can use the linker script to remove
the particular sections. However, my target might not support
arbitrary number of sections, and hence I cannot use
-ffunction-sections option.

1) Does there exist any method apart from the one above, to
selectively remove functions from the binary?

2) Can a linker script operate on function level to ask the loader to
load functions (rather than sections) at specific addresses? Or to
omit certain functions in the output?

Thanks in Advance,

Rajat



More information about the Gcc-help mailing list