[all-commits] [llvm/llvm-project] 1302fd: [ELF] Avoid adding an orphan section to a less sui...

Igor Kudrin via All-commits all-commits at lists.llvm.org
Wed Oct 20 21:40:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1302fdc233f424dbc8d15d7d88dc894dd6cdbb6c
      https://github.com/llvm/llvm-project/commit/1302fdc233f424dbc8d15d7d88dc894dd6cdbb6c
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2021-10-21 (Thu, 21 Oct 2021)

  Changed paths:
    M lld/ELF/Writer.cpp
    M lld/test/ELF/aarch64-thunk-pi.s
    M lld/test/ELF/linkerscript/implicit-program-header.test
    A lld/test/ELF/linkerscript/orphan-phdrs2.test

  Log Message:
  -----------
  [ELF] Avoid adding an orphan section to a less suitable segment

If segments are defined in a linker script, placing an orphan section
before the found closest-rank section can result in adding it in a
previous segment and changing flags of that segment. This happens if
the orphan section has a lower sort rank than the found section. To
avoid that, the patch forces orphan sections to be moved after the
found section if segments are explicitly defined.

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




More information about the All-commits mailing list