[PATCH] D43188: [ELF] Make .eh_frame relro if one of the inputs is SHF_WRITE

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 06:48:19 PST 2018


arichardson created this revision.
arichardson added reviewers: ruiu, rafael, atanasyan, grimar, joerg.
Herald added subscribers: llvm-commits, sdardis, emaste.

Previously .eh_frame was always SHF_ALLOC and read-only. However, for
MIPS64 PIC code clang emits a R_MIPS_64 relocation that will be converted
to a dynamic relocation so .eh_frame can't be read-only in that case.
Since the input section has the SHF_WRITE flag set we were adding dynamic
relocations against even though the .eh_frame output section is read-only
without requiring -z notext.
Fix this by making .eh_frame writable if one of the input sections is has
the SHF_WRITE flag.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D43188

Files:
  ELF/SyntheticSections.cpp
  test/ELF/eh-frame-writable.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43188.133851.patch
Type: text/x-patch
Size: 4756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180212/65abe6de/attachment.bin>


More information about the llvm-commits mailing list