[PATCH] PR gold/17640
H.J. Lu
hjl.tools@gmail.com
Thu Mar 12 14:44:00 GMT 2015
On Thu, Mar 12, 2015 at 7:33 AM, Ilya Tocar <tocarip.intel@gmail.com> wrote:
> I've rebased patch against current trunk, and removed blank lines.
> Ok for trunk?
>
> ---
> gold/ChangeLog | 16 +++++
> gold/i386.cc | 122 ++++++++++++++++++++++++++++----------
> gold/testsuite/Makefile.am | 59 ++++++++++++++++++
> gold/testsuite/i386_mov_to_lea.sh | 37 ++++++++++++
> gold/testsuite/i386_mov_to_lea1.s | 11 ++++
> gold/testsuite/i386_mov_to_lea2.s | 10 ++++
> gold/testsuite/i386_mov_to_lea3.s | 4 ++
> gold/testsuite/i386_mov_to_lea4.s | 12 ++++
> gold/testsuite/i386_mov_to_lea5.s | 12 ++++
> 9 files changed, 251 insertions(+), 32 deletions(-)
> create mode 100755 gold/testsuite/i386_mov_to_lea.sh
> create mode 100644 gold/testsuite/i386_mov_to_lea1.s
> create mode 100644 gold/testsuite/i386_mov_to_lea2.s
> create mode 100644 gold/testsuite/i386_mov_to_lea3.s
> create mode 100644 gold/testsuite/i386_mov_to_lea4.s
> create mode 100644 gold/testsuite/i386_mov_to_lea5.s
>
> diff --git a/gold/ChangeLog b/gold/ChangeLog
> index f94e170..8b96819 100644
> --- a/gold/ChangeLog
> +++ b/gold/ChangeLog
> @@ -1,3 +1,19 @@
> +2015-03-12 Ilya Tocar <ilya.tocar@intel.com>
> +
> + PR gold/17640
> + * i386.cc (Target_i386::Scan::local): Don't create GOT entry, when we
> + can convert GOT to GOTOFF.
> + (Target_i386::Scan::global): Ditto.
> + (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
> + lea foo@GOTOFF(%reg), %reg if possible.
> + * testsuite/Makefile.am (i386_mov_to_lea): New test.
> + * testsuite/i386_mov_to_lea1.s: New.
> + * testsuite/i386_mov_to_lea2.s: Ditto.
> + * testsuite/i386_mov_to_lea3.s: Ditto.
> + * testsuite/i386_mov_to_lea4.s: Ditto.
> + * testsuite/i386_mov_to_lea5.s: Ditto.
> + * testsuite/i386_mov_to_lea.sh: Ditto.
> +
> 2015-03-11 Cary Coutant <ccoutant@google.com>
>
> * options.cc (General_options::finalize): Don't allow -z relro
> diff --git a/gold/i386.cc b/gold/i386.cc
> index 24f4103..108f1fb 100644
> --- a/gold/i386.cc
> +++ b/gold/i386.cc
> @@ -1835,8 +1835,27 @@ Target_i386::Scan::local(Symbol_table* symtab,
>
> case elfcpp::R_386_GOT32:
> {
> - // The symbol requires a GOT entry.
> + // We need GOT section.
> Output_data_got<32, false>* got = target->got_section(symtab, layout);
> +
> + // If the relocation symbol isn't IFUNC,
> + // and is local, then we will convert
> + // mov foo@GOT(%reg), %reg
> + // to
> + // lea foo@GOTOFF(%reg), %reg
> + // in Relocate::relocate
> + if (reloc.get_r_offset() >= 2
> + && lsym.get_st_type() != elfcpp::STT_GNU_IFUNC)
> + {
> + section_size_type stype;
> + const unsigned char* view = object->section_contents(data_shndx,
> + &stype, true);
> + if (view[reloc.get_r_offset() - 2] == 0x8b)
> + break;
> +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please remove the blank line.
--
H.J.
More information about the Binutils
mailing list