Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rtld: Workaround Morello LLVM lld bug with local-caprelocs=elf
Morello LLVM's lld always emits PLT-related .dynamic entries when ELF local caprelocs are used even if the PLT is empty. This confuses rtld which tries to treat the start of the binary as a GOT PLT. In particular, rtld itself ends up with an empty PLT and so rtld tries to write to its ELF header which crashes since the page is mapped read-only. Workaround this by ignoring DT_JMPREL and DT_PLTGOT entries whose value is 0. The PLT GOT and PLT relocation table can never be at the start of a valid binary.
- Loading branch information