x86: Add VERIFY_COPY_RELOC

Add VERIFY_COPY_RELOC to verify that symbol supports copy relocation.

	* elfxx-x86.h (VERIFY_COPY_RELOC): New.
	* elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
This commit is contained in:
H.J. Lu
2017-10-06 00:50:12 -07:00
parent f3180fa9ee
commit ff38b4cc55
4 changed files with 17 additions and 14 deletions

View File

@@ -3908,13 +3908,7 @@ do_glob_dat:
asection *s;
/* This symbol needs a copy reloc. Set it up. */
if (h->dynindx == -1
|| (h->root.type != bfd_link_hash_defined
&& h->root.type != bfd_link_hash_defweak)
|| htab->elf.srelbss == NULL
|| htab->elf.sreldynrelro == NULL)
abort ();
VERIFY_COPY_RELOC (h, htab)
rel.r_offset = (h->root.u.def.value
+ h->root.u.def.section->output_section->vma