aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-08-17 03:54:05 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-08-17 03:54:16 -0700
commitbfb1e8c15a6b7d02cd0b9a124d01722a07ebf09a (patch)
treeca561553a9b38085c41dd850e2678b209c860c90 /bfd/elfxx-x86.h
parent2ecae92e2372102ac0fa774fce4c4c0d6f8c85f5 (diff)
downloadgdb-bfb1e8c15a6b7d02cd0b9a124d01722a07ebf09a.zip
gdb-bfb1e8c15a6b7d02cd0b9a124d01722a07ebf09a.tar.gz
gdb-bfb1e8c15a6b7d02cd0b9a124d01722a07ebf09a.tar.bz2
x86: Remove empty X86_FEATURE_1_AND property
There is no need to generate .note.gnu.property section with empty X86_FEATURE_1_AND property. This patch adds fixup_gnu_properties to ELF linker backend so that x86 backend can remove it. bfd/ PR ld/23515 * elf-bfd.h (elf_backend_data): Add fixup_gnu_properties. * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Call backend fixup_gnu_properties if it isn't NULL. Discard .note.gnu.property section if all properties have been removed. * elfxx-target.h (elf_backend_fixup_gnu_properties): New. (elfNN_bed): Initialize fixup_gnu_properties. * elfxx-x86.c (_bfd_x86_elf_link_fixup_gnu_properties): New function. * elfxx-x86.h (_bfd_x86_elf_link_fixup_gnu_properties): New prototype. (elf_backend_fixup_gnu_properties): New. ld/ PR ld/23515 * testsuite/ld-i386/ibt-plt-2a.d: Updated. * testsuite/ld-i386/ibt-plt-2b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b.d: Likewise.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r--bfd/elfxx-x86.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index 6a56094..9648438 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -684,6 +684,9 @@ extern enum elf_property_kind _bfd_x86_elf_parse_gnu_properties
extern bfd_boolean _bfd_x86_elf_merge_gnu_properties
(struct bfd_link_info *, bfd *, elf_property *, elf_property *);
+extern void _bfd_x86_elf_link_fixup_gnu_properties
+ (struct bfd_link_info *, elf_property_list **);
+
extern bfd * _bfd_x86_elf_link_setup_gnu_properties
(struct bfd_link_info *, struct elf_x86_init_table *);
@@ -726,3 +729,5 @@ extern void _bfd_x86_elf_link_fixup_ifunc_symbol
_bfd_x86_elf_parse_gnu_properties
#define elf_backend_merge_gnu_properties \
_bfd_x86_elf_merge_gnu_properties
+#define elf_backend_fixup_gnu_properties \
+ _bfd_x86_elf_link_fixup_gnu_properties