From: Stan Shebs Date: Wed, 27 Feb 2019 22:03:33 +0000 (-0800) Subject: Remove .llvm_addrsig sections from crt.o files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4c787ff1b1f33defe1da576fa3f83321e5c1555;p=thirdparty%2Fglibc.git Remove .llvm_addrsig sections from crt.o files --- diff --git a/csu/Makefile b/csu/Makefile index f3498960f89..7460bcb0cf1 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -106,7 +106,13 @@ include ../Rules subdir_lib: $(extra-objs:%=$(objpfx)%) define link-relocatable -$(CC) -nostdlib -nostartfiles -r -o $@ $^ +$(CC) -nostdlib -nostartfiles -r -o $@.precopy $^ +# Remove a section generated by clang for safe ICF; when lld links and +# retains relocs, the section is garbled and causes errors in later +# links done with --icf=safe. The removal can be unconditional as it +# is a no-op for non-clang/lld. +$(OBJCOPY) --remove-section=.llvm_addrsig $@.precopy $@ +rm $@.precopy endef ifndef start-installed-name-rule