Removed generation of the PT_GNU_PROPERTY segment sandbox/akazmin/gnu_prop_segment
authorAndrey Kazmin <a.kazmin@partner.samsung.com>
Fri, 24 Jan 2020 14:58:51 +0000 (17:58 +0300)
committerAndrey Kazmin <a.kazmin@partner.samsung.com>
Mon, 27 Jan 2020 12:59:07 +0000 (15:59 +0300)
Because it is currently unused and duplicates gnu.property
section in PT_NOTE segment

Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
bfd/elf.c
ld/testsuite/ld-aarch64/property-bti-pac4-a.d [deleted file]
ld/testsuite/ld-aarch64/property-bti-pac4-b.d [deleted file]
ld/testsuite/ld-aarch64/property-bti-pac4.s [deleted file]

index 5a061c9..a232b9e 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4428,14 +4428,6 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
       ++segs;
     }
 
-  s = bfd_get_section_by_name (abfd,
-                              NOTE_GNU_PROPERTY_SECTION_NAME);
-  if (s != NULL && s->size != 0)
-    {
-      /* We need a PT_GNU_PROPERTY segment.  */
-      ++segs;
-    }
-
   for (s = abfd->sections; s != NULL; s = s->next)
     {
       if ((s->flags & SEC_LOAD) != 0
@@ -5121,24 +5113,6 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
              pm = &m->next;
            }
 
-      s = bfd_get_section_by_name (abfd,
-                                  NOTE_GNU_PROPERTY_SECTION_NAME);
-      if (s != NULL && s->size != 0)
-       {
-         amt = sizeof (struct elf_segment_map) + sizeof (asection *);
-         m = bfd_zalloc (abfd, amt);
-         if (m == NULL)
-           goto error_return;
-         m->next = NULL;
-         m->p_type = PT_GNU_PROPERTY;
-         m->count = 1;
-         m->p_flags_valid = 1;
-         m->sections[0] = s;
-         m->p_flags = PF_R;
-         *pm = m;
-         pm = &m->next;
-       }
-
       /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME
         segment.  */
       eh_frame_hdr = elf_eh_frame_hdr (abfd);
diff --git a/ld/testsuite/ld-aarch64/property-bti-pac4-a.d b/ld/testsuite/ld-aarch64/property-bti-pac4-a.d
deleted file mode 100644 (file)
index d9aa5cf..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#name: PT_GNU_PROPERTY alignment
-#source: property-bti-pac4.s
-#as: -mabi=lp64
-#ld: -z force-bti -e main
-#readelf: -l --wide
-#target: *linux*
-#warning: .*property-bti-pac4.*: warning: BTI turned on by -z force-bti.*
-
-#...
-  GNU_PROPERTY .* +0x8
-#...
diff --git a/ld/testsuite/ld-aarch64/property-bti-pac4-b.d b/ld/testsuite/ld-aarch64/property-bti-pac4-b.d
deleted file mode 100644 (file)
index 02f9fc5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#name: PT_GNU_PROPERTY alignment ILP32
-#source: property-bti-pac4.s
-#as: -mabi=ilp32
-#ld: -m [aarch64_choose_ilp32_emul] -z force-bti -e main
-#readelf: -l --wide
-#target: *linux*
-#warning: .*property-bti-pac4.*: warning: BTI turned on by -z force-bti.*
-
-#...
-  GNU_PROPERTY .* +0x4
-#...
diff --git a/ld/testsuite/ld-aarch64/property-bti-pac4.s b/ld/testsuite/ld-aarch64/property-bti-pac4.s
deleted file mode 100644 (file)
index a1122ff..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-       .arch armv8-a
-       .file   "t.c"
-       .text
-       .align  2
-       .p2align 3,,7
-       .global f
-       .type   f, %function
-f:
-       add     w0, w0, 1
-       ret
-       .size   f, .-f
-       .section        .text.startup,"ax",@progbits
-       .align  2
-       .p2align 3,,7
-       .global main
-       .type   main, %function
-main:
-       mov     w0, 6
-       ret
-       .size   main, .-main
-       .section        .note.GNU-stack,"",@progbits