[all-commits] [llvm/llvm-project] 16c30c: [ELF] Change --shuffle-sections=<seed> to --shuffl...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Mar 18 10:18:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 16c30c3c23ef02c0227256bb6f2005a574517de9
      https://github.com/llvm/llvm-project/commit/16c30c3c23ef02c0227256bb6f2005a574517de9
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/Options.td
    M lld/ELF/Writer.cpp
    M lld/docs/ReleaseNotes.rst
    M lld/docs/ld.lld.1
    M lld/test/ELF/gnu-ifunc-plt.s
    M lld/test/ELF/shuffle-sections-init-fini.s
    M lld/test/ELF/shuffle-sections.s

  Log Message:
  -----------
  [ELF] Change --shuffle-sections=<seed> to --shuffle-sections=<section-glob>=<seed>

`--shuffle-sections=<seed>` applies to all sections.  The new
`--shuffle-sections=<section-glob>=<seed>` makes shuffling selective.  To the
best of my knowledge, the option is only used as debugging, so just drop the
original form.

`--shuffle-sections '.init_array*=-1'` `--shuffle-sections '.fini_array*=-1'`.
reverses static constructors/destructors of the same priority.
Useful to detect some static initialization order fiasco.

`--shuffle-sections '.data*=-1'`
reverses `.data*` sections. Useful to detect unfunded pointer comparison results
of two unrelated objects.

If certain sections have an intrinsic order, the old form cannot be used.

Differential Revision: https://reviews.llvm.org/D98679




More information about the All-commits mailing list