[PATCH] D47249: [ELF] Implement --icf=safe

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 23:56:07 PDT 2018


MaskRay created this revision.
MaskRay added reviewers: ruiu, echristo, pcc.
Herald added subscribers: llvm-commits, arichardson, mgorny, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: espindola.

--icf=safe is used in some Android and Chrome builds.

In C++, ctors and dtors are not allowed to be taken addresses. This
property is exploited by gold --icf=safe to fold only ctors and dtors, which is safer than --icf=all.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47249

Files:
  ELF/CMakeLists.txt
  ELF/Config.h
  ELF/Driver.cpp
  ELF/ICF.cpp
  ELF/Options.td
  test/ELF/icf-safe.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47249.148162.patch
Type: text/x-patch
Size: 5761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180523/06ad661a/attachment.bin>


More information about the llvm-commits mailing list