[all-commits] [llvm/llvm-project] 423cb3: [ELF] Special case --shuffle-sections=-1 to revers...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Mar 17 09:33:07 PDT 2021


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

  Changed paths:
    M lld/ELF/Options.td
    M lld/ELF/Writer.cpp
    M lld/docs/ld.lld.1
    M lld/test/ELF/shuffle-sections.s

  Log Message:
  -----------
  [ELF] Special case --shuffle-sections=-1 to reverse input sections

If the number of sections changes, which is common for re-links after
incremental updates, the section order may change drastically.

Special case -1 to reverse input sections. This is a stable transform.
The section order is more resilient to incremental updates.  Usually the
code issue (e.g. Static Initialization Order Fiasco, assuming pointer
comparison result of two unrelated objects) is due to the relative order
between two problematic input files A and B.  Checking the regular order
and the reversed order is sufficient.

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




More information about the All-commits mailing list