RFC: ld: Add --section-ordering-file FILE

Nick Clifton nickc@redhat.com
Wed Apr 17 14:14:00 GMT 2019


Hi H.J.

>>   * Couldn't the same result be achieved by using a custom linker script ?
> 
> Yes.  This is much easier to use than a custom linker script.

Agreed.  But easier does not necessarily mean better, especially if
it introduces a new potential place for bugs.

Plus - are you trying to solve a particular problem with this new feature ?
Why is it even worth adding it in ?

> --section-ordering-file is a short hand to place a list of sections at
> 
>  .text           :
>   {
>     *(.text.unlikely .text.*_unlikely .text.unlikely.*)
>     *(.text.exit .text.exit.*)
>     *(.text.startup .text.startup.*)
>     INCLUDE config.section_ordering_file;  <<<<<<<<< here.
>     *(.text.hot .text.hot.*)
>     *(.text .stub .text.* .gnu.linkonce.t.*)
>     /* .gnu.warning sections are handled specially by elf32.em.  */
>     *(.gnu.warning)
>   }

(Presumably ordinary .text and .text.* sections are included in the
above section as well ?)

So that makes sense, but if is implemented wouldn't it also be reasonable
to add support for read-only and read-write data section lists as well ?

Cheers
  Nick



More information about the Binutils mailing list