RFC: Assign regions to orphan sections

Daniel Jacobowitz dan@codesourcery.com
Tue Mar 16 14:14:00 GMT 2010


On Tue, Mar 16, 2010 at 09:04:17PM +1030, Alan Modra wrote:
> On Tue, Mar 16, 2010 at 08:18:49AM +0100, Simon Richter wrote:
> > Would it make sense to have a mode (-z noorphans or something
> > such) where the link would fail if any orphan sections were present, to
> > aid in debugging linker scripts?
> 
> You can do that easily enough with something like the following at the
> end of your SECTIONS.
> 
>   catchall :
>   {
>     *(*)
>     ASSERT (. == 0, "Orphan section")
>   }

IMO, either that should be in the manual, or there should be a linker
option; there's a ton of things that you can do with GNU ld, that only
its maintainers can figure out how to do :-)

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list