public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Remove .llvm_addrsig sections from crt.o files
@ 2021-08-28  0:30 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:30 UTC (permalink / raw)
  To: glibc-cvs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Remove .llvm_addrsig sections from crt.o files
@ 2021-08-28  0:26 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:26 UTC (permalink / raw)
  To: glibc-cvs

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

commit 1fcb2574ab6a20d4a66ff4d188e318fa446543a7
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Remove .llvm_addrsig sections from crt.o files
@ 2021-08-27 23:49 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-27 23:49 UTC (permalink / raw)
  To: glibc-cvs

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

commit 1461e8b3526d4f2b4ce8ffe554d549efd07845b7
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-28  0:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:30 [glibc/maskray/grte] Remove .llvm_addrsig sections from crt.o files Fangrui Song
  -- strict thread matches above, loose matches on Subject: below --
2021-08-28  0:26 Fangrui Song
2021-08-27 23:49 Fangrui Song

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).