public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Fangrui Song <maskray@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/maskray/grte] Remove .llvm_addrsig sections from crt.o files
Date: Sat, 28 Aug 2021 00:30:54 +0000 (GMT)	[thread overview]
Message-ID: <20210828003054.D3D433857C7F@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c4c787ff1b1f33defe1da576fa3f83321e5c1555

commit c4c787ff1b1f33defe1da576fa3f83321e5c1555
Author: Stan Shebs <stanshebs@google.com>
Date:   Wed Feb 27 14:03:33 2019 -0800

    Remove .llvm_addrsig sections from crt.o files

Diff:
---
 csu/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/csu/Makefile b/csu/Makefile
index f3498960f8..7460bcb0cf 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


             reply	other threads:[~2021-08-28  0:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-28  0:30 Fangrui Song [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-28  0:26 Fangrui Song
2021-08-27 23:49 Fangrui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210828003054.D3D433857C7F@sourceware.org \
    --to=maskray@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).