On Fri, Feb 28, 2020 at 6:30 AM H.J. Lu <hjl.to...@gmail.com> wrote:
>
> When generating the separate file with LTO debug sections, we should
> also copy .note.gnu.property section.
>
> OK for master if there is no regression?
>
> Thanks.
>
> H.J.
> ---
> libiberty/
>
>         PR lto/93966
>         * simple-object.c (handle_lto_debug_sections): Also copy
>         .note.gnu.property section.
>
> gcc/
>
>         PR lto/93966
>         * configure.ac (HAVE_LD_CET_REPORT_SUPPORT): New.  Set to 1 if
>         linker supports -z cet-report=.
>         * config.in: Regenerated.
>         * configure: Likewise.
>
> gcc/testsuite/
>
>         PR lto/93966
>         * gcc.target/i386/pr93966.c: New file.
>         * lib/target-supports.exp (check_effective_target_cet_report): New.

The test will fail on non-CET enabled OS.   Here is the updated patch without
testcase.    OK for master and backport to GCC 8/9 branches?

Thanks.


-- 
H.J.
From 3504e52532359db1697f741606d04fd43d852e0a Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.to...@gmail.com>
Date: Fri, 28 Feb 2020 06:22:18 -0800
Subject: [PATCH] lto: Also copy .note.gnu.property section

When generating the separate file with LTO debug sections, we should
also copy .note.gnu.property section.

	PR lto/93966
	* simple-object.c (handle_lto_debug_sections): Also copy
	.note.gnu.property section.
---
 libiberty/simple-object.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libiberty/simple-object.c b/libiberty/simple-object.c
index d9c648af717..e6c466ab767 100644
--- a/libiberty/simple-object.c
+++ b/libiberty/simple-object.c
@@ -293,6 +293,9 @@ handle_lto_debug_sections (const char *name, int rename)
   /* Copy over .note.GNU-stack section under the same name if present.  */
   else if (strcmp (name, ".note.GNU-stack") == 0)
     return strcpy (newname, name);
+  /* Copy over .note.gnu.property section under the same name if present.  */
+  else if (strcmp (name, ".note.gnu.property") == 0)
+    return strcpy (newname, name);
   /* Copy over .comment section under the same name if present.  Solaris
      ld uses them to relax its checking of ELF gABI access rules for
      COMDAT sections in objects produced by GCC.  */
-- 
2.24.1

Reply via email to