[PATCH] D17857: [ELF] - DT_TEXTREL/DF_TEXTREL flags implemented.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 10:27:15 PST 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.

This patch implements DT_TEXTREL/DF_TEXTREL flags. Actually I am not sure in current implementation and would be happy to know the side opinion about it.
Problem of that feature is that somehow we should know that relocation should cause a modification of read only segment.

To do that I am checking that relocation OKind field is DynamicReloc<ELFT>::Off_Sec. Looks it is safe and correct way to use it for that ?
Also for simplification I am not iterating through sections in LOADs and just checking the read/write flag of output sections when adding relocations during Writer<ELFT>::scanRelocs().

DT_TEXTREL description:
This member's absence signifies that no relocation entry should cause a modification to a non-writable segment, as specified by the segment permissions in the program header table. If this member is present, one or more relocation entries might request modifications to a non-writable segment, and the dynamic linker can prepare accordingly. This entry is at level 2. Its use has been superseded by the DF_TEXTREL flag.

http://reviews.llvm.org/D17857

Files:
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  test/ELF/textrel.s
  test/ELF/tls-opt-iele-i686-nopic.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17857.49750.patch
Type: text/x-patch
Size: 6010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160303/665289cf/attachment.bin>


More information about the llvm-commits mailing list