This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed, PATCH] PR ld/20244: Subtract GOT base only with a base register
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Tue, 14 Jun 2016 16:03:02 -0700
- Subject: Re: [committed, PATCH] PR ld/20244: Subtract GOT base only with a base register
- Authentication-results: sourceware.org; auth=none
- References: <20160612042508 dot GA7482 at gmail dot com>
On Sat, Jun 11, 2016 at 9:25 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> When relocating R_386_GOT32 in "op $0, bar@GOT", we shouldn't subtract
> GOT base without a base register and we should disallow it without a
> base register for PIC.
>
> bfd/
>
> PR ld/20244
> * elf32-i386.c (elf_i386_relocate_section): When relocating
> R_386_GOT32, return error without a base register for PIC and
> subtract the .got.plt section address only with a base register.
>
> ld/
>
> PR ld/20244
> * testsuite/ld-i386/i386.exp: Run pr20244-1a and pr20244-1b.
> * testsuite/ld-i386/pr20244-1.s: New file.
> * testsuite/ld-i386/pr20244-1a.d: Likewise.
> * testsuite/ld-i386/pr20244-1b.d: Likewise.
> * testsuite/ld-i386/pr20244-1c.d: Likewise.
> ---
> bfd/ChangeLog | 7 +++++++
> bfd/elf32-i386.c | 36 ++++++++++++++++++++++++++++++++----
> ld/ChangeLog | 9 +++++++++
> ld/testsuite/ld-i386/i386.exp | 3 +++
> ld/testsuite/ld-i386/pr20244-1.s | 17 +++++++++++++++++
> ld/testsuite/ld-i386/pr20244-1a.d | 26 ++++++++++++++++++++++++++
> ld/testsuite/ld-i386/pr20244-1b.d | 11 +++++++++++
> ld/testsuite/ld-i386/pr20244-1c.d | 4 ++++
> 8 files changed, 109 insertions(+), 4 deletions(-)
> create mode 100644 ld/testsuite/ld-i386/pr20244-1.s
> create mode 100644 ld/testsuite/ld-i386/pr20244-1a.d
> create mode 100644 ld/testsuite/ld-i386/pr20244-1b.d
> create mode 100644 ld/testsuite/ld-i386/pr20244-1c.d
>
I backported it to 2.26.
H.J.