aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-12-08 09:12:13 +0100
committerMartin Liska <mliska@suse.cz>2022-12-14 08:48:13 +0100
commit8ad93045edcff5128fccc8bff23848f2cfae6453 (patch)
tree5296a7e2552a1a8329c925fe266a649fd2d821a2 /bfd
parentd0517d6e333c4b6aaae411648628e2923e1f83aa (diff)
downloadfsf-binutils-gdb-8ad93045edcff5128fccc8bff23848f2cfae6453.zip
fsf-binutils-gdb-8ad93045edcff5128fccc8bff23848f2cfae6453.tar.gz
fsf-binutils-gdb-8ad93045edcff5128fccc8bff23848f2cfae6453.tar.bz2
ld, gold: remove support for -z bndplt (MPX prefix)
bfd/ChangeLog: * elf-linker-x86.h (struct elf_linker_x86_params): Remove bndplt. * elf64-x86-64.c (elf_x86_64_scan_relocs): Ignore R_X86_64_PLT32_BND. (elf_x86_64_relocate_section): Similarly here. (elf_x86_64_link_setup_gnu_properties): Ignore bndplt. * elfxx-x86.c: Likewise. * elfxx-x86.h: Likewise. gold/ChangeLog: * NEWS: Document -z bndplt. * options.h (class General_options): Remove bndplt option. * x86_64.cc (class Output_data_plt_x86_64_bnd): Remove. (Target_x86_64::do_make_data_plt): Do not use Output_data_plt_x86_64_bnd. (Target_x86_64::Scan::get_reference_flags): Likewise. (Target_x86_64::Scan::check_non_pic): Likewise. (Target_x86_64::Scan::local): Likewise. (Target_x86_64::Scan::global): Likewise. ld/ChangeLog: * NEWS: Document -z bndplt. * emulparams/elf_x86_64.sh: Remove bndplt option. * ld.texi: Likewise. * testsuite/ld-x86-64/x86-64.exp: * testsuite/ld-x86-64/bnd-branch-1-now.d: Removed. * testsuite/ld-x86-64/bnd-branch-1.d: Removed. * testsuite/ld-x86-64/bnd-branch-1.s: Removed. * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-1.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-1.s: Removed. * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-2.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-2.s: Removed. * testsuite/ld-x86-64/bnd-plt-1-now.d: Removed. * testsuite/ld-x86-64/bnd-plt-1.d: Removed. * testsuite/ld-x86-64/mpx.exp: Removed. * testsuite/ld-x86-64/mpx1.out: Removed. * testsuite/ld-x86-64/mpx1a.c: Removed. * testsuite/ld-x86-64/mpx1a.rd: Removed. * testsuite/ld-x86-64/mpx1b.c: Removed. * testsuite/ld-x86-64/mpx1c.c: Removed. * testsuite/ld-x86-64/mpx1c.rd: Removed. * testsuite/ld-x86-64/mpx2.out: Removed. * testsuite/ld-x86-64/mpx2a.c: Removed. * testsuite/ld-x86-64/mpx2a.rd: Removed. * testsuite/ld-x86-64/mpx2b.c: Removed. * testsuite/ld-x86-64/mpx2c.c: Removed. * testsuite/ld-x86-64/mpx2c.rd: Removed. * testsuite/ld-x86-64/mpx3.dd: Removed. * testsuite/ld-x86-64/mpx3a.s: Removed. * testsuite/ld-x86-64/mpx3b.s: Removed. * testsuite/ld-x86-64/mpx3n.dd: Removed. * testsuite/ld-x86-64/mpx4.dd: Removed. * testsuite/ld-x86-64/mpx4a.s: Removed. * testsuite/ld-x86-64/mpx4b.s: Removed. * testsuite/ld-x86-64/mpx4n.dd: Removed. * testsuite/ld-x86-64/pr20800a.S: Removed. * testsuite/ld-x86-64/pr20800b.S: Removed. * testsuite/ld-x86-64/pr21038a-now.d: Removed. * testsuite/ld-x86-64/pr21038a.d: Removed. * testsuite/ld-x86-64/pr21038a.s: Removed. * testsuite/ld-x86-64/pr21038b-now.d: Removed. * testsuite/ld-x86-64/pr21038b.d: Removed. * testsuite/ld-x86-64/pr21038b.s: Removed. * testsuite/ld-x86-64/pr21038c-now.d: Removed. * testsuite/ld-x86-64/pr21038c.d: Removed. * testsuite/ld-x86-64/pr21038c.s: Removed.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf-linker-x86.h3
-rw-r--r--bfd/elf64-x86-64.c22
-rw-r--r--bfd/elfxx-x86.c16
-rw-r--r--bfd/elfxx-x86.h2
4 files changed, 5 insertions, 38 deletions
diff --git a/bfd/elf-linker-x86.h b/bfd/elf-linker-x86.h
index 19462e0..0badcf8 100644
--- a/bfd/elf-linker-x86.h
+++ b/bfd/elf-linker-x86.h
@@ -31,9 +31,6 @@ enum elf_x86_prop_report
/* Used to pass x86-specific linker options from ld to bfd. */
struct elf_linker_x86_params
{
- /* TRUE if BND prefix in PLT entries is always generated. */
- unsigned int bndplt: 1;
-
/* TRUE if IBT-enabled PLT entries should be generated. */
unsigned int ibtplt: 1;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 2a5f5a5..afc8c76 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2197,7 +2197,6 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info,
break;
case R_X86_64_PLT32:
- case R_X86_64_PLT32_BND:
/* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol,
because this might be a case of linking PIC code which is
@@ -2256,7 +2255,6 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info,
case R_X86_64_PC8:
case R_X86_64_PC16:
case R_X86_64_PC32:
- case R_X86_64_PC32_BND:
case R_X86_64_PC64:
case R_X86_64_64:
pointer:
@@ -2289,8 +2287,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info,
}
}
}
- else if (r_type != R_X86_64_PC32_BND
- && r_type != R_X86_64_PC64)
+ else if (r_type != R_X86_64_PC64)
{
/* At run-time, R_X86_64_64 can be resolved for both
x86-64 and x32. But R_X86_64_32 and R_X86_64_32S
@@ -2905,10 +2902,8 @@ elf_x86_64_relocate_section (bfd *output_bfd,
}
/* FALLTHROUGH */
case R_X86_64_PC32:
- case R_X86_64_PC32_BND:
case R_X86_64_PC64:
case R_X86_64_PLT32:
- case R_X86_64_PLT32_BND:
goto do_relocation;
}
}
@@ -3172,7 +3167,6 @@ elf_x86_64_relocate_section (bfd *output_bfd,
break;
case R_X86_64_PLT32:
- case R_X86_64_PLT32_BND:
/* Relocation is to the entry for this symbol in the
procedure linkage table. */
@@ -3227,7 +3221,6 @@ elf_x86_64_relocate_section (bfd *output_bfd,
case R_X86_64_PC8:
case R_X86_64_PC16:
case R_X86_64_PC32:
- case R_X86_64_PC32_BND:
/* Don't complain about -fPIC if the symbol is undefined when
building executable unless it is unresolved weak symbol,
references a dynamic definition in PIE or -z nocopyreloc
@@ -5317,16 +5310,9 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
htab = elf_x86_hash_table (info, bed->target_id);
if (!htab)
abort ();
- if (htab->params->bndplt)
- {
- init_table.lazy_plt = &elf_x86_64_lazy_bnd_plt;
- init_table.non_lazy_plt = &elf_x86_64_non_lazy_bnd_plt;
- }
- else
- {
- init_table.lazy_plt = &elf_x86_64_lazy_plt;
- init_table.non_lazy_plt = &elf_x86_64_non_lazy_plt;
- }
+
+ init_table.lazy_plt = &elf_x86_64_lazy_plt;
+ init_table.non_lazy_plt = &elf_x86_64_non_lazy_plt;
init_table.lazy_ibt_plt = &elf_x32_lazy_ibt_plt;
init_table.non_lazy_ibt_plt = &elf_x32_non_lazy_ibt_plt;
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 88c34d3..2ddca34 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -4415,20 +4415,6 @@ _bfd_x86_elf_link_setup_gnu_properties
if (!bfd_set_section_alignment (sec, plt_alignment))
goto error_alignment;
}
- else if (htab->params->bndplt && ABI_64_P (dynobj))
- {
- /* Create the second PLT for Intel MPX support. MPX
- PLT is supported only in 64-bit mode and is needed
- only for lazy binding. */
- sec = bfd_make_section_anyway_with_flags (dynobj,
- ".plt.sec",
- pltflags);
- if (sec == NULL)
- info->callbacks->einfo (_("%F%P: failed to create BND PLT section\n"));
-
- if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
- goto error_alignment;
- }
htab->plt_second = sec;
}
@@ -4499,7 +4485,7 @@ _bfd_x86_elf_link_setup_gnu_properties
htab->plt_sframe = sec;
- /* Second PLT is generated for Intel IBT / MPX Support + lazy plt. */
+ /* Second PLT is generated for Intel IBT + lazy plt. */
if (htab->plt_second != NULL)
{
sec = bfd_make_section_anyway_with_flags (dynobj,
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index 83f417a..18ecd03 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -36,7 +36,6 @@
((TYPE) == R_X86_64_PC8 \
|| (TYPE) == R_X86_64_PC16 \
|| (TYPE) == R_X86_64_PC32 \
- || (TYPE) == R_X86_64_PC32_BND \
|| (TYPE) == R_X86_64_PC64)
#define I386_PCREL_TYPE_P(TYPE) ((TYPE) == R_386_PC32)
#define X86_PCREL_TYPE_P(IS_X86_64, TYPE) \
@@ -103,7 +102,6 @@
((TYPE) == R_X86_64_PC8 \
|| (TYPE) == R_X86_64_PC16 \
|| (TYPE) == R_X86_64_PC32 \
- || (TYPE) == R_X86_64_PC32_BND \
|| (TYPE) == R_X86_64_PC64)
/* This must be the same as sframe_get_hdr_size (sfh). For x86-64, this value