This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [committed, PATCH] PR ld/20244: Subtract GOT base only with a base register


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]