[PATCH] D40967: [LLD][ELF] Remove Duplicate .ARM.exidx sections

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 03:15:39 PST 2017


peter.smith updated this revision to Diff 126516.
peter.smith added a comment.

Thanks very much for the review comments. I've updated the diff to apply them. The one I haven't done yet is std::unique as I don't think I can make the predicate an equivalence relation without missing opportunities. For an example consider two consecutive (made up) unwind entries { 0xabababab, 0x1 } and { 0x1, 0x1, 0x1 }; I can merge the second into the first but not the first into the second. My guess is that the libstdc++ and libc++ implementations of std::unique will let us get away with the predicate not being symmetric but I have memories of the Visual Studio debug implementation actively checking all the preconditions required by the standard.

An alternative would be to write a version of std::unique inline, perhaps in the place of // Remove the Sections we marked as duplicate earlier. That would allow us to remove the middle chunk that sets duplicates to nullptr. Doing the unique check on the unified list does have the advantage of detecting duplicates across an InputSectionDescription boundary but I think that this wouldn't be common or significant in size. Let me know what you think?


https://reviews.llvm.org/D40967

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/Options.td
  ELF/Writer.cpp
  test/ELF/arm-exidx-dedup.s
  test/ELF/arm-exidx-gc.s
  test/ELF/arm-exidx-order.s
  test/ELF/arm-exidx-sentinel-orphan.s
  test/ELF/arm-static-defines.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40967.126516.patch
Type: text/x-patch
Size: 12381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171212/5b422940/attachment.bin>


More information about the llvm-commits mailing list