Convert mov to lea only if needed
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 27 Feb 2015 19:27:31 +0000 (11:27 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 27 Feb 2015 19:35:37 +0000 (11:35 -0800)
commitc1d11331c9d84541b5002314f8cee2f302dd5763
tree20a1c9d6079f76f679264cae50cc74d1c6a1cdf4
parentbf36a1e7df75608045be60a5d16a1df207df3464
Convert mov to lea only if needed

We can convert mov to lea only if there are R_386_GOT32/R_X86_64_GOTPCREL
relocations against non IFUNC symbols.

* elf32-i386.c (need_convert_mov_to_lea): New.
(elf_i386_check_relocs): Set need_convert_mov_to_lea if needed.
(elf_i386_convert_mov_to_lea): Return TRUE if
need_convert_mov_to_lea is unset.
* elf64-x86-64.c (need_convert_mov_to_lea): New.
(elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed.
(elf_x86_64_convert_mov_to_lea): Return TRUE if
need_convert_mov_to_lea is unset.
bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c