[PATCH] D24604: [ELF] - Implemented --sort-section cmd line option and SORT_NONE script command.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 03:05:19 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.

This fixes Bug 30385 - SORT_NONE not implemented,

`SORT_NONE' disables section sorting by ignoring the command line
section sorting option.

That is why this patch also implements --sort-section option.

Full rules of applying sorting (from ld manual) are:

>    When both command line section sorting option and linker script
> section sorting command are used, section sorting command always takes
> precedence over the command line option.
> 
>    If the section sorting command in linker script isn't nested, the
> command line option will make the section sorting command to be treated
> as nested sorting command.
> 
>   1. `SORT_BY_NAME' (wildcard section pattern ) with `--sort-sections
>      alignment' is equivalent to `SORT_BY_NAME' (`SORT_BY_ALIGNMENT'
>      (wildcard section pattern)).
> 
>   2. `SORT_BY_ALIGNMENT' (wildcard section pattern) with
>      `--sort-section name' is equivalent to `SORT_BY_ALIGNMENT'
>      (`SORT_BY_NAME' (wildcard section pattern)).
> 
>    If the section sorting command in linker script is nested, the
> command line option will be ignored.



https://reviews.llvm.org/D24604

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/Options.td
  test/ELF/linkerscript/sort-nested.s
  test/ELF/linkerscript/sort.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24604.71489.patch
Type: text/x-patch
Size: 5861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160915/4290ebad/attachment.bin>


More information about the llvm-commits mailing list