This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Does gold support deadcode elimination on relocatable files
>> There is work underway to do deadcode elimination, but not during a
>> relocatable link.
>
> Could you show the reason why you don't have this for a relocatable file?
I don't think there's a fundamental reason, but gold doesn't currently
offer any options for transforming global symbols into locals during a
relocatable link, and you'd need something like that before you could
make good use of deadcode elimination with ld -r. Without that, you
need to treat every global symbol definition as being potentially
reachable from outside, and about the only things you could eliminate
would be unreachable static functions or data.
-cary