[all-commits] [llvm/llvm-project] f639b5: [ELF] Simplify getSectionRank

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed May 29 20:08:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f639b57f7993cadb82ee9c36f04703ae4430ed85
      https://github.com/llvm/llvm-project/commit/f639b57f7993cadb82ee9c36f04703ae4430ed85
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-05-29 (Wed, 29 May 2024)

  Changed paths:
    M lld/ELF/Writer.cpp

  Log Message:
  -----------
  [ELF] Simplify getSectionRank

Follow-up to a previous simplification
2473b1af085ad54e89666cedf684fdf10a84f058.

The xor difference between a SHT_NOTE and a read-only SHT_PROGBITS
(previously >=NOT_SPECIAL) should be smaller than RF_EXEC. Otherwise,
for the following section layout, `findOrphanPos` would place .text
before note.

```
// simplified from linkerscript/custom-section-type.s
non orphans:
progbits 0x8060c00 NOT_SPECIAL
note     0x8040003

orphan:
.text    0x8061000 NOT_SPECIAL
```

---

Identical to 2e0cfe69d0d705e9c5d5f217625bf7e3a0e90871.
The revert 30c10fda2ba539e70bff4f05625ec6358c0f7502 is wrong.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list