This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Unused functions not being removed


Hello all,

I have recently noticed that some of the unused functions in my code
aren't being removed.
It appears that the problem occurs due to ld, but only when building
for the avr.

My code is compiled using -fdata-sections and -ffunction-sections to
create object files.
Then, per each source directory, different object files are combined
into one object via "ld -r".
Finally, those objects are compiled together using gcc --gc-sections.
This should remove any unused functions, as it does under x86, but fails on avr.
After running objdump on the various objects, it appears that gcc is
correctly creating the sections, but "ld -r" is removing the separate
sections.

Is this supposed to happen and is there a way to disable this?

Thanks for any help.


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