Does gold support deadcode elimination on relocatable files

Neo Jia neojia@gmail.com
Thu Dec 18 02:33:00 GMT 2008


On Wed, Dec 17, 2008 at 5:46 PM, Cary Coutant <ccoutant@google.com> wrote:
>>>> Just wondering if the current gold support deadcode elimination with
>>>> -r option. If not, any plan on that?
>>>
>>> There is work underway to do deadcode elimination, but not during a
>>> relocatable link.
>>
>> Do we have any plan for that? If not, I would like to take a look.
>
> Not that I'm aware of. You'll probably want to wait until the patch to
> implement it for regular links is submitted, though. It looks like it
> won't be too long.
>
> Are you planning on just eliminating unreachable local symbols, or
> will you provide some way to identify a subset of globals to be
> exported from the resulting output file?

I think I am more interested in the later part, since not all of the
exported library API is used. We can use some sore of API header file
to build up a root set and do mark-sweep from there.

Thanks,
Neo

>
> -cary
>



-- 
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!



More information about the Binutils mailing list