This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: How to link in sub-object ganularity
> > I guess the problem is that the linker cannot crack sections, so first I
> > would need to specify GCC to put each (extern) symbol into a different
> > section and than instruct the linker to do a per-section linking.
>
> gcc -ffunction-sections
> ld --gc-sections
>
> See the documentation.
>
> Ian
Wow! Thanks so much for the fast answer. (In my defense: I've read through
the docs, but I haven't connected 'garbage-collection' to this behavior.)
Anyway, I've tried it and it works great for ELF targets but not for COFF
(or PE for that matter). I've read it in the src/ld/NEWS file
that --gc-sections support was implemented for ELF only. Are there plans to
add support for COFF too?
Thanks again,
Andras Tantos