[PATCH] D19953: ELF: Do not use -1 to mark pieces of merge sections as being tail merged.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 19:34:13 PDT 2016


pcc created this revision.
pcc added reviewers: rafael, ruiu.
pcc added a subscriber: llvm-commits.

We were previously using an output offset of -1 for both GC'd and tail
merged pieces. We need to distinguish these two cases in order to filter
GC'd symbols from the symbol table -- we were previously asserting when we
asked for the VA of a symbol pointing into a dead piece, which would end
up asking the tail merging string table for an offset even though we hadn't
initialized it properly.

This patch fixes the bug by using an offset of -1 to exclusively mean GC'd
pieces, using 0 for tail merges, and distinguishing the tail merge case from
an offset of 0 by asking the output section whether it is tail merge.

http://reviews.llvm.org/D19953

Files:
  ELF/InputSection.cpp
  ELF/OutputSections.cpp
  ELF/OutputSections.h
  ELF/Writer.cpp
  test/ELF/string-gc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19953.56232.patch
Type: text/x-patch
Size: 4132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160505/530ee9fe/attachment.bin>


More information about the llvm-commits mailing list