[PATCH] D29327: [LLD][ELF] Use Synthetic Sections for Thunks (try 2)

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 06:43:36 PST 2017


peter.smith created this revision.

This is https://reviews.llvm.org/D29129 with the Windows debug build problems fixed.

The MSVC debug implementation of std::merge enforces the preconditions required by the C++ standard. This includes checking that both ranges are sortable by the predicate and that if (A < B) then !(B > A). https://reviews.llvm.org/D29129 the comparison routine did not conform to the requirements of the standard. This change fixes the predicate.

The changes made are all related to the comparison routine:
SyntheticSections:

- add getTargetInputSection to ThunkSection
- correct section flags in constructor. ThunkSections was missing SHF_EXECINSTR

Relocations:

- Set the OutSecOff of the per-OutputSection ThunkSection to be the limit of the executable sections, previously we set the OutSecOff to size, and checked in the predicate whether the Thunk and InputSection were executable.
- Rewrite the MergeComp predicate to use only OutSecOff and as a tie-breaker for Mips LA25 whether the next section is our Thunks Target.

I've checked that this builds and runs the tests on MSVC 2015. Sending for review as it is more than just a simple syntax fix.


https://reviews.llvm.org/D29327

Files:
  ELF/InputFiles.cpp
  ELF/InputSection.cpp
  ELF/InputSection.h
  ELF/LTO.cpp
  ELF/LTO.h
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/SymbolTable.cpp
  ELF/Symbols.cpp
  ELF/Symbols.h
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h
  ELF/Target.cpp
  ELF/Target.h
  ELF/Thunks.cpp
  ELF/Thunks.h
  ELF/Writer.cpp
  test/ELF/arm-thumb-interwork-shared.s
  test/ELF/arm-thumb-interwork-thunk.s
  test/ELF/mips-npic-call-pic.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29327.86420.patch
Type: text/x-patch
Size: 73510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170131/ac312261/attachment-0001.bin>


More information about the llvm-commits mailing list