x86-64: Rename .plt.bnd to .plt.sec

Rename .plt.bnd to .plt.sec to indicate that this is used as the second
PLT section.  There is no change in run-time behavior.  We also scan the
.plt.sec section to synthesize PLT symbols.

bfd/

	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
	to plt_second.
	(elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
	to plt_second/plt_second_eh_frame.
	(elf_x86_64_link_hash_newfunc): Updated.
	(elf_x86_64_allocate_dynrelocs): Likewise.
	(elf_x86_64_size_dynamic_sections): Likewise.
	(elf_x86_64_relocate_section): Likewise.
	(elf_x86_64_finish_dynamic_symbol): Likewise.
	(elf_x86_64_finish_dynamic_sections): Likewise.
	(elf_x86_64_plt_type): Rename plt_bnd to plt_second.
	(elf_x86_64_get_synthetic_symtab): Updated.  Also scan the
	.plt.sec section.
	(elf_backend_setup_gnu_properties): Updated.  Create the
	.plt.sec section instead of the .plt.sec section.

ld/

	* emulparams/elf_x86_64.sh (TINY_READONLY_SECTION): Replace
	.plt.bnd with .plt.sec.
	* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
	* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
	* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
	* testsuite/ld-x86-64/mpx3.dd: Likewise.
	* testsuite/ld-x86-64/mpx3n.dd: Likewise.
	* testsuite/ld-x86-64/mpx4.dd: Likewise.
	* testsuite/ld-x86-64/mpx4n.dd: Likewise.
	* testsuite/ld-x86-64/plt-main-bnd-now.rd: Likewise.
	* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
	* testsuite/ld-x86-64/pr21038b.d: Likewise.
	* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
	* testsuite/ld-x86-64/pr21038c.d: Likewise.
This commit is contained in:
H.J. Lu
2017-05-11 11:26:26 -07:00
parent dc2be3d2f6
commit f2c29a1692
18 changed files with 140 additions and 102 deletions

View File

@ -1,3 +1,21 @@
2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
* elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
to plt_second.
(elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
to plt_second/plt_second_eh_frame.
(elf_x86_64_link_hash_newfunc): Updated.
(elf_x86_64_allocate_dynrelocs): Likewise.
(elf_x86_64_size_dynamic_sections): Likewise.
(elf_x86_64_relocate_section): Likewise.
(elf_x86_64_finish_dynamic_symbol): Likewise.
(elf_x86_64_finish_dynamic_sections): Likewise.
(elf_x86_64_plt_type): Rename plt_bnd to plt_second.
(elf_x86_64_get_synthetic_symtab): Updated. Also scan the
.plt.sec section.
(elf_backend_setup_gnu_properties): Updated. Create the
.plt.sec section instead of the .plt.sec section.
2017-05-11 H.J. Lu <hongjiu.lu@intel.com> 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert

View File

@ -936,9 +936,8 @@ struct elf_x86_64_link_hash_entry
GOT and PLT relocations against the same function. */ GOT and PLT relocations against the same function. */
union gotplt_union plt_got; union gotplt_union plt_got;
/* Information about the second PLT entry. Filled when info>bndplt is /* Information about the second PLT entry. */
set. */ union gotplt_union plt_second;
union gotplt_union plt_bnd;
/* Offset of the GOTPLT entry reserved for the TLS descriptor, /* Offset of the GOTPLT entry reserved for the TLS descriptor,
starting at the end of the jump table. */ starting at the end of the jump table. */
@ -989,8 +988,8 @@ struct elf_x86_64_link_hash_table
/* Short-cuts to get to dynamic linker sections. */ /* Short-cuts to get to dynamic linker sections. */
asection *interp; asection *interp;
asection *plt_eh_frame; asection *plt_eh_frame;
asection *plt_bnd; asection *plt_second;
asection *plt_bnd_eh_frame; asection *plt_second_eh_frame;
asection *plt_got; asection *plt_got;
asection *plt_got_eh_frame; asection *plt_got_eh_frame;
@ -1089,7 +1088,7 @@ elf_x86_64_link_hash_newfunc (struct bfd_hash_entry *entry,
eh->no_finish_dynamic_symbol = 0; eh->no_finish_dynamic_symbol = 0;
eh->tls_get_addr = 2; eh->tls_get_addr = 2;
eh->func_pointer_refcount = 0; eh->func_pointer_refcount = 0;
eh->plt_bnd.offset = (bfd_vma) -1; eh->plt_second.offset = (bfd_vma) -1;
eh->plt_got.offset = (bfd_vma) -1; eh->plt_got.offset = (bfd_vma) -1;
eh->tlsdesc_got = (bfd_vma) -1; eh->tlsdesc_got = (bfd_vma) -1;
} }
@ -3036,13 +3035,13 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
* plt_entry_size), * plt_entry_size),
GOT_ENTRY_SIZE, TRUE)) GOT_ENTRY_SIZE, TRUE))
{ {
asection *s = htab->plt_bnd; asection *s = htab->plt_second;
if (h->plt.offset != (bfd_vma) -1 && s != NULL) if (h->plt.offset != (bfd_vma) -1 && s != NULL)
{ {
/* Use the .plt.bnd section if it is created. */ /* Use the second PLT section if it is created. */
eh->plt_bnd.offset = s->size; eh->plt_second.offset = s->size;
/* Make room for this entry in the .plt.bnd section. */ /* Make room for this entry in the second PLT section. */
s->size += htab->non_lazy_plt->plt_entry_size; s->size += htab->non_lazy_plt->plt_entry_size;
} }
@ -3078,7 +3077,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
{ {
asection *s = htab->elf.splt; asection *s = htab->elf.splt;
asection *bnd_s = htab->plt_bnd; asection *second_s = htab->plt_second;
asection *got_s = htab->plt_got; asection *got_s = htab->plt_got;
/* If this is the first .plt entry, make room for the special /* If this is the first .plt entry, make room for the special
@ -3092,8 +3091,8 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
else else
{ {
h->plt.offset = s->size; h->plt.offset = s->size;
if (bnd_s) if (second_s)
eh->plt_bnd.offset = bnd_s->size; eh->plt_second.offset = second_s->size;
} }
/* If this symbol is not defined in a regular file, and we are /* If this symbol is not defined in a regular file, and we are
@ -3113,12 +3112,12 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
} }
else else
{ {
if (bnd_s) if (second_s)
{ {
/* We need to make a call to the entry of the second /* We need to make a call to the entry of the
PLT instead of regular PLT entry. */ second PLT instead of regular PLT entry. */
h->root.u.def.section = bnd_s; h->root.u.def.section = second_s;
h->root.u.def.value = eh->plt_bnd.offset; h->root.u.def.value = eh->plt_second.offset;
} }
else else
{ {
@ -3134,8 +3133,8 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
else else
{ {
s->size += plt_entry_size; s->size += plt_entry_size;
if (bnd_s) if (second_s)
bnd_s->size += htab->non_lazy_plt->plt_entry_size; second_s->size += htab->non_lazy_plt->plt_entry_size;
/* We also need to make an entry in the .got.plt section, /* We also need to make an entry in the .got.plt section,
which will be placed in the .got section by the linker which will be placed in the .got section by the linker
@ -3762,13 +3761,13 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
htab->plt_got_eh_frame->size htab->plt_got_eh_frame->size
= htab->non_lazy_plt->eh_frame_plt_size; = htab->non_lazy_plt->eh_frame_plt_size;
/* Unwind info for .plt.bnd and .plt.got sections are /* Unwind info for the second PLT and .plt.got sections are
identical. */ identical. */
if (htab->plt_bnd_eh_frame != NULL if (htab->plt_second_eh_frame != NULL
&& htab->plt_bnd != NULL && htab->plt_second != NULL
&& htab->plt_bnd->size != 0 && htab->plt_second->size != 0
&& !bfd_is_abs_section (htab->plt_bnd->output_section)) && !bfd_is_abs_section (htab->plt_second->output_section))
htab->plt_bnd_eh_frame->size htab->plt_second_eh_frame->size
= htab->non_lazy_plt->eh_frame_plt_size; = htab->non_lazy_plt->eh_frame_plt_size;
} }
@ -3785,11 +3784,11 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
|| s == htab->elf.sgotplt || s == htab->elf.sgotplt
|| s == htab->elf.iplt || s == htab->elf.iplt
|| s == htab->elf.igotplt || s == htab->elf.igotplt
|| s == htab->plt_bnd || s == htab->plt_second
|| s == htab->plt_got || s == htab->plt_got
|| s == htab->plt_eh_frame || s == htab->plt_eh_frame
|| s == htab->plt_got_eh_frame || s == htab->plt_got_eh_frame
|| s == htab->plt_bnd_eh_frame || s == htab->plt_second_eh_frame
|| s == htab->elf.sdynbss || s == htab->elf.sdynbss
|| s == htab->elf.sdynrelro) || s == htab->elf.sdynrelro)
{ {
@ -3861,14 +3860,14 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
+ PLT_FDE_LEN_OFFSET)); + PLT_FDE_LEN_OFFSET));
} }
if (htab->plt_bnd_eh_frame != NULL if (htab->plt_second_eh_frame != NULL
&& htab->plt_bnd_eh_frame->contents != NULL) && htab->plt_second_eh_frame->contents != NULL)
{ {
memcpy (htab->plt_bnd_eh_frame->contents, memcpy (htab->plt_second_eh_frame->contents,
htab->non_lazy_plt->eh_frame_plt, htab->non_lazy_plt->eh_frame_plt,
htab->plt_bnd_eh_frame->size); htab->plt_second_eh_frame->size);
bfd_put_32 (dynobj, htab->plt_bnd->size, bfd_put_32 (dynobj, htab->plt_second->size,
(htab->plt_bnd_eh_frame->contents (htab->plt_second_eh_frame->contents
+ PLT_FDE_LEN_OFFSET)); + PLT_FDE_LEN_OFFSET));
} }
@ -4333,10 +4332,10 @@ elf_x86_64_relocate_section (bfd *output_bfd,
/* STT_GNU_IFUNC symbol must go through PLT. */ /* STT_GNU_IFUNC symbol must go through PLT. */
if (htab->elf.splt != NULL) if (htab->elf.splt != NULL)
{ {
if (htab->plt_bnd != NULL) if (htab->plt_second != NULL)
{ {
resolved_plt = htab->plt_bnd; resolved_plt = htab->plt_second;
plt_offset = eh->plt_bnd.offset; plt_offset = eh->plt_second.offset;
} }
else else
{ {
@ -4697,10 +4696,10 @@ do_ifunc_pointer:
resolved_plt = htab->plt_got; resolved_plt = htab->plt_got;
plt_offset = eh->plt_got.offset; plt_offset = eh->plt_got.offset;
} }
else if (htab->plt_bnd != NULL) else if (htab->plt_second != NULL)
{ {
resolved_plt = htab->plt_bnd; resolved_plt = htab->plt_second;
plt_offset = eh->plt_bnd.offset; plt_offset = eh->plt_second.offset;
} }
else else
{ {
@ -4740,10 +4739,10 @@ do_ifunc_pointer:
if (h->plt.offset != (bfd_vma) -1) if (h->plt.offset != (bfd_vma) -1)
{ {
if (htab->plt_bnd != NULL) if (htab->plt_second != NULL)
{ {
resolved_plt = htab->plt_bnd; resolved_plt = htab->plt_second;
plt_offset = eh->plt_bnd.offset; plt_offset = eh->plt_second.offset;
} }
else else
{ {
@ -5647,7 +5646,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
Elf_Internal_Sym *sym) Elf_Internal_Sym *sym)
{ {
struct elf_x86_64_link_hash_table *htab; struct elf_x86_64_link_hash_table *htab;
bfd_boolean use_plt_bnd; bfd_boolean use_plt_second;
struct elf_x86_64_link_hash_entry *eh; struct elf_x86_64_link_hash_entry *eh;
bfd_boolean local_undefweak; bfd_boolean local_undefweak;
@ -5655,9 +5654,8 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
if (htab == NULL) if (htab == NULL)
return FALSE; return FALSE;
/* Use MPX backend data in case of BND relocation. Use .plt_bnd /* Use the second PLT section only if there is .plt section. */
section only if there is .plt section. */ use_plt_second = htab->elf.splt != NULL && htab->plt_second != NULL;
use_plt_bnd = htab->elf.splt != NULL && htab->plt_bnd != NULL;
eh = (struct elf_x86_64_link_hash_entry *) h; eh = (struct elf_x86_64_link_hash_entry *) h;
if (eh->no_finish_dynamic_symbol) if (eh->no_finish_dynamic_symbol)
@ -5733,14 +5731,14 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
/* Fill in the entry in the procedure linkage table. */ /* Fill in the entry in the procedure linkage table. */
memcpy (plt->contents + h->plt.offset, htab->plt.plt_entry, memcpy (plt->contents + h->plt.offset, htab->plt.plt_entry,
htab->plt.plt_entry_size); htab->plt.plt_entry_size);
if (use_plt_bnd) if (use_plt_second)
{ {
memcpy (htab->plt_bnd->contents + eh->plt_bnd.offset, memcpy (htab->plt_second->contents + eh->plt_second.offset,
htab->non_lazy_plt->plt_entry, htab->non_lazy_plt->plt_entry,
htab->non_lazy_plt->plt_entry_size); htab->non_lazy_plt->plt_entry_size);
resolved_plt = htab->plt_bnd; resolved_plt = htab->plt_second;
plt_offset = eh->plt_bnd.offset; plt_offset = eh->plt_second.offset;
} }
else else
{ {
@ -5968,10 +5966,10 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
/* For non-shared object, we can't use .got.plt, which /* For non-shared object, we can't use .got.plt, which
contains the real function addres if we need pointer contains the real function addres if we need pointer
equality. We load the GOT entry with the PLT entry. */ equality. We load the GOT entry with the PLT entry. */
if (htab->plt_bnd != NULL) if (htab->plt_second != NULL)
{ {
plt = htab->plt_bnd; plt = htab->plt_second;
plt_offset = eh->plt_bnd.offset; plt_offset = eh->plt_second.offset;
} }
else else
{ {
@ -6274,8 +6272,8 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
elf_section_data (htab->plt_got->output_section) elf_section_data (htab->plt_got->output_section)
->this_hdr.sh_entsize = htab->non_lazy_plt->plt_entry_size; ->this_hdr.sh_entsize = htab->non_lazy_plt->plt_entry_size;
if (htab->plt_bnd != NULL && htab->plt_bnd->size > 0) if (htab->plt_second != NULL && htab->plt_second->size > 0)
elf_section_data (htab->plt_bnd->output_section) elf_section_data (htab->plt_second->output_section)
->this_hdr.sh_entsize = htab->non_lazy_plt->plt_entry_size; ->this_hdr.sh_entsize = htab->non_lazy_plt->plt_entry_size;
/* GOT is always created in setup_gnu_properties. But it may not be /* GOT is always created in setup_gnu_properties. But it may not be
@ -6361,29 +6359,31 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd,
} }
} }
/* Adjust .eh_frame for .plt.bnd section. */ /* Adjust .eh_frame for the second PLT section. */
if (htab->plt_bnd_eh_frame != NULL if (htab->plt_second_eh_frame != NULL
&& htab->plt_bnd_eh_frame->contents != NULL) && htab->plt_second_eh_frame->contents != NULL)
{ {
if (htab->plt_bnd != NULL if (htab->plt_second != NULL
&& htab->plt_bnd->size != 0 && htab->plt_second->size != 0
&& (htab->plt_bnd->flags & SEC_EXCLUDE) == 0 && (htab->plt_second->flags & SEC_EXCLUDE) == 0
&& htab->plt_bnd->output_section != NULL && htab->plt_second->output_section != NULL
&& htab->plt_bnd_eh_frame->output_section != NULL) && htab->plt_second_eh_frame->output_section != NULL)
{ {
bfd_vma plt_start = htab->plt_bnd->output_section->vma; bfd_vma plt_start = htab->plt_second->output_section->vma;
bfd_vma eh_frame_start = htab->plt_bnd_eh_frame->output_section->vma bfd_vma eh_frame_start
+ htab->plt_bnd_eh_frame->output_offset = (htab->plt_second_eh_frame->output_section->vma
+ PLT_FDE_START_OFFSET; + htab->plt_second_eh_frame->output_offset
+ PLT_FDE_START_OFFSET);
bfd_put_signed_32 (dynobj, plt_start - eh_frame_start, bfd_put_signed_32 (dynobj, plt_start - eh_frame_start,
htab->plt_bnd_eh_frame->contents htab->plt_second_eh_frame->contents
+ PLT_FDE_START_OFFSET); + PLT_FDE_START_OFFSET);
} }
if (htab->plt_bnd_eh_frame->sec_info_type == SEC_INFO_TYPE_EH_FRAME) if (htab->plt_second_eh_frame->sec_info_type
== SEC_INFO_TYPE_EH_FRAME)
{ {
if (! _bfd_elf_write_section_eh_frame (output_bfd, info, if (! _bfd_elf_write_section_eh_frame (output_bfd, info,
htab->plt_bnd_eh_frame, htab->plt_second_eh_frame,
htab->plt_bnd_eh_frame->contents)) htab->plt_second_eh_frame->contents))
return FALSE; return FALSE;
} }
} }
@ -6448,7 +6448,7 @@ enum elf_x86_64_plt_type
{ {
plt_non_lazy = 0, plt_non_lazy = 0,
plt_lazy = 1 << 0, plt_lazy = 1 << 0,
plt_bnd = 1 << 1, plt_second = 1 << 1,
plt_unknown = -1 plt_unknown = -1
}; };
@ -6496,7 +6496,8 @@ elf_x86_64_get_synthetic_symtab (bfd *abfd,
{ {
{ ".plt", NULL, NULL, plt_unknown, 0, 0, 0, 0 }, { ".plt", NULL, NULL, plt_unknown, 0, 0, 0, 0 },
{ ".plt.got", NULL, NULL, plt_non_lazy, 0, 0, 0, 0 }, { ".plt.got", NULL, NULL, plt_non_lazy, 0, 0, 0, 0 },
{ ".plt.bnd", NULL, NULL, plt_bnd, 0, 0, 0, 0 }, { ".plt.sec", NULL, NULL, plt_second, 0, 0, 0, 0 },
{ ".plt.bnd", NULL, NULL, plt_second, 0, 0, 0, 0 },
{ NULL, NULL, NULL, plt_non_lazy, 0, 0, 0, 0 } { NULL, NULL, NULL, plt_non_lazy, 0, 0, 0, 0 }
}; };
@ -6572,7 +6573,7 @@ elf_x86_64_get_synthetic_symtab (bfd *abfd,
&& (memcmp (plt_contents + 6, && (memcmp (plt_contents + 6,
lazy_bnd_plt->plt0_entry + 6, 3) == 0)) lazy_bnd_plt->plt0_entry + 6, 3) == 0))
{ {
plt_type = plt_lazy | plt_bnd; plt_type = plt_lazy | plt_second;
lazy_plt = lazy_bnd_plt; lazy_plt = lazy_bnd_plt;
} }
} }
@ -6587,13 +6588,13 @@ elf_x86_64_get_synthetic_symtab (bfd *abfd,
} }
if (non_lazy_bnd_plt != NULL if (non_lazy_bnd_plt != NULL
&& (plt_type == plt_unknown || plt_type == plt_bnd)) && (plt_type == plt_unknown || plt_type == plt_second))
{ {
/* Match BND PLT. */ /* Match BND PLT. */
if (memcmp (plt_contents, non_lazy_bnd_plt->plt_entry, if (memcmp (plt_contents, non_lazy_bnd_plt->plt_entry,
non_lazy_bnd_plt->plt_got_offset) == 0) non_lazy_bnd_plt->plt_got_offset) == 0)
{ {
plt_type = plt_bnd; plt_type = plt_second;
non_lazy_plt = non_lazy_bnd_plt; non_lazy_plt = non_lazy_bnd_plt;
} }
} }
@ -6620,8 +6621,8 @@ elf_x86_64_get_synthetic_symtab (bfd *abfd,
i = 0; i = 0;
} }
/* Skip lazy PLT with BND. */ /* Skip lazy PLT when the second PLT is used. */
if (plt_type == (plt_lazy |plt_bnd)) if (plt_type == (plt_lazy | plt_second))
plts[j].count = 0; plts[j].count = 0;
else else
{ {
@ -7248,7 +7249,7 @@ error_alignment:
{ {
/* Create the second PLT for Intel MPX support. */ /* Create the second PLT for Intel MPX support. */
sec = bfd_make_section_anyway_with_flags (dynobj, sec = bfd_make_section_anyway_with_flags (dynobj,
".plt.bnd", ".plt.sec",
pltflags); pltflags);
if (sec == NULL) if (sec == NULL)
info->callbacks->einfo (_("%F: failed to create BND PLT section\n")); info->callbacks->einfo (_("%F: failed to create BND PLT section\n"));
@ -7257,7 +7258,7 @@ error_alignment:
non_lazy_plt_alignment)) non_lazy_plt_alignment))
goto error_alignment; goto error_alignment;
htab->plt_bnd = sec; htab->plt_second = sec;
} }
} }
@ -7294,7 +7295,7 @@ error_alignment:
htab->plt_got_eh_frame = sec; htab->plt_got_eh_frame = sec;
} }
if (htab->plt_bnd != NULL) if (htab->plt_second != NULL)
{ {
sec = bfd_make_section_anyway_with_flags (dynobj, sec = bfd_make_section_anyway_with_flags (dynobj,
".eh_frame", ".eh_frame",
@ -7305,7 +7306,7 @@ error_alignment:
if (!bfd_set_section_alignment (dynobj, sec, 3)) if (!bfd_set_section_alignment (dynobj, sec, 3))
goto error_alignment; goto error_alignment;
htab->plt_bnd_eh_frame = sec; htab->plt_second_eh_frame = sec;
} }
} }
} }

View File

@ -1,3 +1,22 @@
2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
* emulparams/elf_x86_64.sh (TINY_READONLY_SECTION): Replace
.plt.bnd with .plt.sec.
* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
* testsuite/ld-x86-64/mpx3.dd: Likewise.
* testsuite/ld-x86-64/mpx3n.dd: Likewise.
* testsuite/ld-x86-64/mpx4.dd: Likewise.
* testsuite/ld-x86-64/mpx4n.dd: Likewise.
* testsuite/ld-x86-64/plt-main-bnd-now.rd: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038b.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
2017-05-11 H.J. Lu <hongjiu.lu@intel.com> 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-i386/plt-pic2.dd: Updated. * testsuite/ld-i386/plt-pic2.dd: Updated.

View File

@ -24,7 +24,7 @@ IREL_IN_PLT=
# Reuse TINY_READONLY_SECTION which is placed right after .plt section. # Reuse TINY_READONLY_SECTION which is placed right after .plt section.
TINY_READONLY_SECTION=" TINY_READONLY_SECTION="
.plt.got ${RELOCATING-0} : { *(.plt.got) } .plt.got ${RELOCATING-0} : { *(.plt.got) }
.plt.bnd ${RELOCATING-0} : { *(.plt.bnd) } .plt.sec ${RELOCATING-0} : { *(.plt.sec) }
" "
if [ "x${host}" = "x${target}" ]; then if [ "x${host}" = "x${target}" ]; then

View File

@ -16,7 +16,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 1f0 <.plt> +[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 1f0 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+210 <\*ABS\*\+0x218@plt>: 0+210 <\*ABS\*\+0x218@plt>:
+[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200350 <_GLOBAL_OFFSET_TABLE_\+0x18> +[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200350 <_GLOBAL_OFFSET_TABLE_\+0x18>

View File

@ -25,7 +25,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2b0 <.plt> +[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2b0 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+300 <\*ABS\*\+0x32c@plt>: 0+300 <\*ABS\*\+0x32c@plt>:
+[a-f0-9]+: f2 ff 25 59 01 20 00 bnd jmpq \*0x200159\(%rip\) # 200460 <_GLOBAL_OFFSET_TABLE_\+0x18> +[a-f0-9]+: f2 ff 25 59 01 20 00 bnd jmpq \*0x200159\(%rip\) # 200460 <_GLOBAL_OFFSET_TABLE_\+0x18>

View File

@ -20,7 +20,7 @@
[ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2b0 <.*> [ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 2b0 <.*>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) [ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+300 <\*ABS\*\+0x32c@plt>: 0+300 <\*ABS\*\+0x32c@plt>:
[ ]*[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200440 <_GLOBAL_OFFSET_TABLE_\+0x18> [ ]*[a-f0-9]+: f2 ff 25 39 01 20 00 bnd jmpq \*0x200139\(%rip\) # 200440 <_GLOBAL_OFFSET_TABLE_\+0x18>

View File

@ -25,7 +25,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 290 <.plt> +[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 290 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+2e0 <foo2@plt>: 0+2e0 <foo2@plt>:
+[a-f0-9]+: f2 ff 25 61 01 20 00 bnd jmpq \*0x200161\(%rip\) # 200448 <foo2> +[a-f0-9]+: f2 ff 25 61 01 20 00 bnd jmpq \*0x200161\(%rip\) # 200448 <foo2>

View File

@ -25,7 +25,7 @@ Disassembly of section .plt:
[ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 290 <.*> [ ]*[a-f0-9]+: f2 e9 b5 ff ff ff bnd jmpq 290 <.*>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) [ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+2e0 <foo2@plt>: 0+2e0 <foo2@plt>:
[ ]*[a-f0-9]+: f2 ff 25 41 01 20 00 bnd jmpq \*0x200141\(%rip\) # 200428 <foo2> [ ]*[a-f0-9]+: f2 ff 25 41 01 20 00 bnd jmpq \*0x200141\(%rip\) # 200428 <foo2>

View File

@ -11,7 +11,7 @@ Disassembly of section .plt:
[ ]*[a-f0-9]+: f2 e9 ([0-9a-f]{2} ){4} bnd jmpq [a-f0-9]+ <.plt> [ ]*[a-f0-9]+: f2 e9 ([0-9a-f]{2} ){4} bnd jmpq [a-f0-9]+ <.plt>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) [ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+[a-f0-9]+ <call1@plt>: 0+[a-f0-9]+ <call1@plt>:
[ ]*[a-f0-9]+: f2 ff ([0-9a-f]{2} ){5} bnd jmpq \*0x[a-f0-9]+\(%rip\) # [a-f0-9]+ <call1> [ ]*[a-f0-9]+: f2 ff ([0-9a-f]{2} ){5} bnd jmpq \*0x[a-f0-9]+\(%rip\) # [a-f0-9]+ <call1>

View File

@ -11,7 +11,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400290 <.plt> +[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400290 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+4002b0 <call1@plt>: 0+4002b0 <call1@plt>:
+[a-f0-9]+: f2 ff 25 91 01 20 00 bnd jmpq \*0x200191\(%rip\) # 600448 <call1> +[a-f0-9]+: f2 ff 25 91 01 20 00 bnd jmpq \*0x200191\(%rip\) # 600448 <call1>

View File

@ -11,7 +11,7 @@ Disassembly of section .plt:
[ ]*[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400260 <.plt> [ ]*[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400260 <.plt>
[ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) [ ]*[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+400280 <call1@plt>: 0+400280 <call1@plt>:
[ ]*[a-f0-9]+: f2 ff 25 31 01 20 00 bnd jmpq \*0x200131\(%rip\) # 6003b8 <call1> [ ]*[a-f0-9]+: f2 ff 25 31 01 20 00 bnd jmpq \*0x200131\(%rip\) # 6003b8 <call1>

View File

@ -11,7 +11,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400260 <.plt> +[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 400260 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+400280 <call1@plt>: 0+400280 <call1@plt>:
+[a-f0-9]+: f2 ff 25 51 01 20 00 bnd jmpq \*0x200151\(%rip\) # 6003d8 <call1> +[a-f0-9]+: f2 ff 25 51 01 20 00 bnd jmpq \*0x200151\(%rip\) # 6003d8 <call1>

View File

@ -1,3 +1,3 @@
#... #...
+\[[ 0-9]+\] \.plt\.bnd +.* +\[[ 0-9]+\] \.plt\.sec +.*
#pass #pass

View File

@ -1,4 +1,4 @@
#name: PR ld/21038 (.plt.bnd, -z now) #name: PR ld/21038 (.plt.sec, -z now)
#source: pr21038b.s #source: pr21038b.s
#as: --64 #as: --64
#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info #ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
@ -57,7 +57,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 220 <.plt> +[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 220 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+240 <func@plt>: 0+240 <func@plt>:
+[a-f0-9]+: f2 ff 25 b1 0d 20 00 bnd jmpq \*0x200db1\(%rip\) # 200ff8 <func> +[a-f0-9]+: f2 ff 25 b1 0d 20 00 bnd jmpq \*0x200db1\(%rip\) # 200ff8 <func>

View File

@ -1,4 +1,4 @@
#name: PR ld/21038 (.plt.bnd) #name: PR ld/21038 (.plt.sec)
#as: --64 #as: --64
#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info #ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
#objdump: -dw -Wf #objdump: -dw -Wf
@ -56,7 +56,7 @@ Disassembly of section .plt:
+[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 220 <.plt> +[a-f0-9]+: f2 e9 e5 ff ff ff bnd jmpq 220 <.plt>
+[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\) +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+240 <func@plt>: 0+240 <func@plt>:
+[a-f0-9]+: f2 ff 25 d1 0d 20 00 bnd jmpq \*0x200dd1\(%rip\) # 201018 <func> +[a-f0-9]+: f2 ff 25 d1 0d 20 00 bnd jmpq \*0x200dd1\(%rip\) # 201018 <func>

View File

@ -1,4 +1,4 @@
#name: PR ld/21038 (.plt.got and .plt.bnd, -z now) #name: PR ld/21038 (.plt.got and .plt.sec, -z now)
#source: pr21038c.s #source: pr21038c.s
#as: --64 #as: --64
#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info #ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
@ -72,7 +72,7 @@ Disassembly of section .plt.got:
+[a-f0-9]+: f2 ff 25 71 0d 20 00 bnd jmpq \*0x200d71\(%rip\) # 200ff8 <func1> +[a-f0-9]+: f2 ff 25 71 0d 20 00 bnd jmpq \*0x200d71\(%rip\) # 200ff8 <func1>
+[a-f0-9]+: 90 nop +[a-f0-9]+: 90 nop
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+288 <func2@plt>: 0+288 <func2@plt>:
+[a-f0-9]+: f2 ff 25 61 0d 20 00 bnd jmpq \*0x200d61\(%rip\) # 200ff0 <func2> +[a-f0-9]+: f2 ff 25 61 0d 20 00 bnd jmpq \*0x200d61\(%rip\) # 200ff0 <func2>

View File

@ -1,4 +1,4 @@
#name: PR ld/21038 (.plt.got and .plt.bnd) #name: PR ld/21038 (.plt.got and .plt.sec)
#as: --64 #as: --64
#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info #ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info
#objdump: -dw -Wf #objdump: -dw -Wf
@ -71,7 +71,7 @@ Disassembly of section .plt.got:
+[a-f0-9]+: f2 ff 25 71 0d 20 00 bnd jmpq \*0x200d71\(%rip\) # 200ff8 <func1> +[a-f0-9]+: f2 ff 25 71 0d 20 00 bnd jmpq \*0x200d71\(%rip\) # 200ff8 <func1>
+[a-f0-9]+: 90 nop +[a-f0-9]+: 90 nop
Disassembly of section .plt.bnd: Disassembly of section .plt.sec:
0+288 <func2@plt>: 0+288 <func2@plt>:
+[a-f0-9]+: f2 ff 25 89 0d 20 00 bnd jmpq \*0x200d89\(%rip\) # 201018 <func2> +[a-f0-9]+: f2 ff 25 89 0d 20 00 bnd jmpq \*0x200d89\(%rip\) # 201018 <func2>