[PATCH] D44898: [ELF] Fix incorrect deduplication of MergeSyntheticSection's

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 08:31:50 PDT 2018


andrewng created this revision.
andrewng added reviewers: ruiu, espindola.
Herald added subscribers: arichardson, emaste.

The Data member of MergeSyntheticSection, which is used by ICF to check
equality of section contents, is always empty. This can result in
incorrect and dangerous deduplication when using --icf=all and
--ignore-data-address-equality.

This simple fix populates the Data of MergeSyntheticSection with the
intended contents in finalizeContents and uses Data for writeTo.

Fixes bug PR36910.


https://reviews.llvm.org/D44898

Files:
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h
  test/ELF/icf-not-equal-merged-sections.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44898.139795.patch
Type: text/x-patch
Size: 3376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180326/40ebb5a0/attachment.bin>


More information about the llvm-commits mailing list