RFC: Add --sort-section to ld

Ian Lance Taylor ian@wasabisystems.com
Thu Aug 26 01:28:00 GMT 2004


"H. J. Lu" <hjl@lucon.org> writes:

> > Why should --sort-section be ignored with a user provided linker
> > script?
> 
> If user wants to sort, he/she can use SORT in his/her linker script.
> But I am not against it for user provided linker scripts.

Yes, the user can use SORT in the explicit linker script, but that is
not a reason to ignore --sort-section for such a script.  The option
has a clear and unambiguous meaning, so why should we ignore it?

> > If we add this, I think it should take a parameter, so that we can
> > specify the type of sort to use.  For example: sort by name, sort by
> > section size.
> 
> What other parameters can it have? The current SORT only sorts by name. 
> Should we also add SORT_SIZE and SORT_NAME? The current SORT will be
> an alias for SORT_NAME.

I don't see a great outcry for SORT_SIZE, and I don't think we need to
add it unless somebody wants it.  I don't even want to say that we
should implement "sort by section size" using --sort-section.  I'm
just saying that I think the proposed --sort-section option should
take a parameter, so that we have the future flexibility when and if
we want it.

Ian



More information about the Binutils mailing list