Use llvm-objcopy, if available, to remove the .llvm_addrsig sections.

This commit is contained in:
Siva Chandra Reddy 2019-04-05 07:46:36 -07:00 committed by Fangrui Song
parent 738baca865
commit 059f0081cf

View File

@ -105,6 +105,12 @@ include ../Rules
# Make these in the lib pass so they're available in time to link things with.
subdir_lib: $(extra-objs:%=$(objpfx)%)
ifeq ($(LLVM_OBJCOPY),)
OBJCOPY_FOR_ADDRSIG = ${OBJCOPY}
else
OBJCOPY_FOR_ADDRSIG = ${LLVM_OBJCOPY}
endif
define link-relocatable
$(CC) -nostdlib -nostartfiles -r -o $@.precopy $^
# Remove a section generated by clang for safe ICF; when lld links and