public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* idea for ld feature: eliding unreferenced input sections
@ 1999-07-07 15:52 Roland McGrath
  1999-07-07 16:00 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Roland McGrath @ 1999-07-07 15:52 UTC (permalink / raw)
  To: binutils

How hard do people think it would be to add an ld feature as follows?

I have in mind a new option, perhaps `--remove-unneeded-sections', that
would tell ld to discard from the output any input sections to which no
relocs in other sections refer.  It could be positional and apply to some
input files and not others, or it could just take the input section
containing the entry point as the root of the section dependency graph. 

I am thinking of using this in combination with something like gcc's
`-ffunction-sections' to achieve the effect of splitting up object files
and omitting the unreferenced ones from the link.

You can think of it as a moral equivalent to `--no-whole-archive' (the
default state of the switch being inverted, of course), considering each
object file to be an "archive of sections".  (The important difference is
that you still have a local symbol scope in each "archive" object file.)


Comments?


Thanks,
Roland

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-07-07 21:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-07 15:52 idea for ld feature: eliding unreferenced input sections Roland McGrath
1999-07-07 16:00 ` Ian Lance Taylor
1999-07-07 16:13   ` Roland McGrath
1999-07-07 20:35   ` Mark E.
1999-07-07 21:02     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).