Remove convert_mov_to_lea
* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Remove convert_mov_to_lea.
This commit is contained in:
parent
8c650f161a
commit
77697d411e
|
@ -1,3 +1,8 @@
|
||||||
|
2015-09-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Remove
|
||||||
|
convert_mov_to_lea.
|
||||||
|
|
||||||
2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
|
2015-09-02 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* elf32-i386.c (R_386_irelative): Renamed to ...
|
* elf32-i386.c (R_386_irelative): Renamed to ...
|
||||||
|
|
|
@ -3010,9 +3010,6 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
|
||||||
asection *tsec;
|
asection *tsec;
|
||||||
char symtype;
|
char symtype;
|
||||||
bfd_vma toff, roff;
|
bfd_vma toff, roff;
|
||||||
enum {
|
|
||||||
none, local, global
|
|
||||||
} convert_mov_to_lea;
|
|
||||||
unsigned int opcode;
|
unsigned int opcode;
|
||||||
|
|
||||||
if (r_type != R_X86_64_GOTPCREL)
|
if (r_type != R_X86_64_GOTPCREL)
|
||||||
|
@ -3030,17 +3027,11 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
|
||||||
if (opcode != 0x8b)
|
if (opcode != 0x8b)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
tsec = NULL;
|
|
||||||
convert_mov_to_lea = none;
|
|
||||||
|
|
||||||
/* Get the symbol referred to by the reloc. */
|
/* Get the symbol referred to by the reloc. */
|
||||||
if (r_symndx < symtab_hdr->sh_info)
|
if (r_symndx < symtab_hdr->sh_info)
|
||||||
{
|
{
|
||||||
Elf_Internal_Sym *isym;
|
Elf_Internal_Sym *isym;
|
||||||
|
|
||||||
/* Silence older GCC warning. */
|
|
||||||
h = NULL;
|
|
||||||
|
|
||||||
isym = bfd_sym_from_r_symndx (&htab->sym_cache,
|
isym = bfd_sym_from_r_symndx (&htab->sym_cache,
|
||||||
abfd, r_symndx);
|
abfd, r_symndx);
|
||||||
|
|
||||||
|
@ -3048,8 +3039,9 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
|
||||||
|
|
||||||
/* STT_GNU_IFUNC must keep R_X86_64_GOTPCREL relocation and
|
/* STT_GNU_IFUNC must keep R_X86_64_GOTPCREL relocation and
|
||||||
skip relocation against undefined symbols. */
|
skip relocation against undefined symbols. */
|
||||||
if (symtype != STT_GNU_IFUNC && isym->st_shndx != SHN_UNDEF)
|
if (symtype == STT_GNU_IFUNC || isym->st_shndx == SHN_UNDEF)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
if (isym->st_shndx == SHN_ABS)
|
if (isym->st_shndx == SHN_ABS)
|
||||||
tsec = bfd_abs_section_ptr;
|
tsec = bfd_abs_section_ptr;
|
||||||
else if (isym->st_shndx == SHN_COMMON)
|
else if (isym->st_shndx == SHN_COMMON)
|
||||||
|
@ -3059,9 +3051,8 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
|
||||||
else
|
else
|
||||||
tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
|
tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
|
||||||
|
|
||||||
|
h = NULL;
|
||||||
toff = isym->st_value;
|
toff = isym->st_value;
|
||||||
convert_mov_to_lea = local;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3084,12 +3075,10 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
|
||||||
tsec = h->root.u.def.section;
|
tsec = h->root.u.def.section;
|
||||||
toff = h->root.u.def.value;
|
toff = h->root.u.def.value;
|
||||||
symtype = h->type;
|
symtype = h->type;
|
||||||
convert_mov_to_lea = global;
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
if (convert_mov_to_lea == none)
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (tsec->sec_info_type == SEC_INFO_TYPE_MERGE)
|
if (tsec->sec_info_type == SEC_INFO_TYPE_MERGE)
|
||||||
{
|
{
|
||||||
|
@ -3168,17 +3157,17 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
|
||||||
changed_contents = TRUE;
|
changed_contents = TRUE;
|
||||||
changed_relocs = TRUE;
|
changed_relocs = TRUE;
|
||||||
|
|
||||||
if (convert_mov_to_lea == local)
|
if (h)
|
||||||
|
{
|
||||||
|
if (h->got.refcount > 0)
|
||||||
|
h->got.refcount -= 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (local_got_refcounts != NULL
|
if (local_got_refcounts != NULL
|
||||||
&& local_got_refcounts[r_symndx] > 0)
|
&& local_got_refcounts[r_symndx] > 0)
|
||||||
local_got_refcounts[r_symndx] -= 1;
|
local_got_refcounts[r_symndx] -= 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (h->got.refcount > 0)
|
|
||||||
h->got.refcount -= 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contents != NULL
|
if (contents != NULL
|
||||||
|
|
Loading…
Reference in New Issue