[all-commits] [llvm/llvm-project] 447aa4: [ELF] Add REVERSE input section description keyword

Justin Cady via All-commits all-commits at lists.llvm.org
Tue Mar 7 09:45:46 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 447aa48b4a02fa9e22fa45b2fb7a85c12df2e6c3
      https://github.com/llvm/llvm-project/commit/447aa48b4a02fa9e22fa45b2fb7a85c12df2e6c3
  Author: Justin Cady <desk at justincady.com>
  Date:   2023-03-07 (Tue, 07 Mar 2023)

  Changed paths:
    M lld/ELF/Config.h
    M lld/ELF/LinkerScript.cpp
    M lld/ELF/ScriptParser.cpp
    M lld/test/ELF/linkerscript/sort-init.s

  Log Message:
  -----------
  [ELF] Add REVERSE input section description keyword

The `REVERSE` keyword is described here:

https://sourceware.org/bugzilla/show_bug.cgi?id=27565

It complements `SORT` by allowing the order of input sections to be reversed.

This is particularly useful for order-dependent sections such as .init_array,
where `REVERSE` can be used to either detect static initialization order fiasco
issues or as a mechanism to maintain .ctors element order while transitioning to
the modern .init_array. Such a transition is described here:

https://discourse.llvm.org/t/is-it-possible-to-manually-specify-init-array-order/68649

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




More information about the All-commits mailing list