Commit 747d670b authored by Fangrui Song's avatar Fangrui Song
Browse files

[ELF] Make .interp/SHT_NOTE not special

Follow-up to a previous simplification
2473b1af.

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
```

rw-text.lds in orphan.s (added by
73e07e92) demonstrates a similar case.
The new behavior is more similar to GNU ld.

#93763 fixed BOLT's brittle reliance on the previous .interp behavior.
parent 73e07e92
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment