From 24aad695beb326f1029f9f9ea9626e0412d0f51d Mon Sep 17 00:00:00 2001 From: Andrey Kazmin Date: Fri, 24 Jan 2020 17:58:51 +0300 Subject: [PATCH] Removed generation of the PT_GNU_PROPERTY segment Because it is currently unused and duplicates gnu.property section in PT_NOTE segment Signed-off-by: Andrey Kazmin --- bfd/elf.c | 26 -------------------------- ld/testsuite/ld-aarch64/property-bti-pac4-a.d | 11 ----------- ld/testsuite/ld-aarch64/property-bti-pac4-b.d | 11 ----------- ld/testsuite/ld-aarch64/property-bti-pac4.s | 21 --------------------- 4 files changed, 69 deletions(-) delete mode 100644 ld/testsuite/ld-aarch64/property-bti-pac4-a.d delete mode 100644 ld/testsuite/ld-aarch64/property-bti-pac4-b.d delete mode 100644 ld/testsuite/ld-aarch64/property-bti-pac4.s diff --git a/bfd/elf.c b/bfd/elf.c index 5a061c9..a232b9e 100644 --- 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 index d9aa5cf..0000000 --- a/ld/testsuite/ld-aarch64/property-bti-pac4-a.d +++ /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 index 02f9fc5..0000000 --- a/ld/testsuite/ld-aarch64/property-bti-pac4-b.d +++ /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 index a1122ff..0000000 --- a/ld/testsuite/ld-aarch64/property-bti-pac4.s +++ /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 -- 2.7.4