[PATCH] D46755: [LLD][ELF] Implement --keep-unique option
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 11 06:59:20 PDT 2018
peter.smith created this revision.
peter.smith added reviewers: ruiu, grimar.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.
The --keep-unique <symbol> option is taken from gold. The intention is that <symbol> will be prevented from being folded by ICF. Although not specifically mentioned in the documentation <symbol> only matches global symbols. In gold the option "unfolds" sections that have been folded due to ICF. For LLD I've decided to make sections defining a global symbol specified by --keep-unique inelligible for ICF.
This option is used within the Android ART runtime for __jit_debug_register_code and __dex_debug_register_code. Supporting it will allow ART to be linked with LLD. I think it could also be used as a basis for --icf=safe (find unsafe symbols and exclude the sections that define them).
https://reviews.llvm.org/D46755
Files:
ELF/Config.h
ELF/Driver.cpp
ELF/ICF.cpp
ELF/Options.td
test/ELF/icf-keep-unique.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46755.146318.patch
Type: text/x-patch
Size: 4939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180511/a005dbb7/attachment.bin>
More information about the llvm-commits
mailing list