[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22966] n64 MIPS: -mplt -msym32 is resulting in assertion ld.orig
From: |
cvs-commit at gcc dot gnu.org |
Subject: |
[Bug ld/22966] n64 MIPS: -mplt -msym32 is resulting in assertion ld.orig: BFD 2.29.1 assertion fail binutils-2.29.1 /bfd/elfxx-mips.c:11234 |
Date: |
Tue, 19 Jun 2018 23:41:31 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22966
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot
gnu.org> ---
The master branch has been updated by Maciej W. Rozycki <address@hidden>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=789ff5b6c26ce7e4ebfcfa5a9a695407c17fa4ea
commit 789ff5b6c26ce7e4ebfcfa5a9a695407c17fa4ea
Author: Maciej W. Rozycki <address@hidden>
Date: Wed Jun 20 00:37:51 2018 +0100
PR ld/22966: Fix n64 MIPS `.got.plt' range checks
The addressable signed 32-bit range for n64 MIPS `.got.plt' references
is from 0xffffffff7fff8000 to 0x7fff7fff, due to how the composition of
an LUI and an LD instruction works for address calculation in the 64-bit
addressing mode, such as when CP0.Status.UX=1.
We currently have a range check in `mips_finish_exec_plt', however it is
not correct as it verifies that the `.got.plt' start address referred is
between 0xffffffff80000000 and 0x7fffffff. It is also implemented as an
assertion rather than a proper error message despite that the situation
can be triggered by user input. Additionally there is no check made for
individual `.got.plt' entries referred even though they can be out of
range while the `.got.plt' start address is not.
Fix all these problems and use the correct range for the check, limiting
it to n64 output files, and then issue a proper error message both in
`mips_finish_exec_plt' and in `_bfd_mips_elf_finish_dynamic_symbol',
suggesting the use of the `-Ttext-segment=...' option that will often
work and with the default linker scripts in particular. Add suitable
tests covering boundary cases.
bfd/
PR ld/22966
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
`.got.plt' entry referred is in range.
(mips_finish_exec_plt): Correct the range check for `.got.plt'
start. Replace the assertion used for that with a proper error
message.
ld/
PR ld/22966
* testsuite/ld-mips-elf/n64-plt-1.dd: New test.
* testsuite/ld-mips-elf/n64-plt-1.gd: New test.
* testsuite/ld-mips-elf/n64-plt-2.ed: New test.
* testsuite/ld-mips-elf/n64-plt-3.ed: New test.
* testsuite/ld-mips-elf/n64-plt-4.dd: New test.
* testsuite/ld-mips-elf/n64-plt-4.gd: New test.
* testsuite/ld-mips-elf/n64-plt-1.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt-2.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt-3.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt-4.ld: New test linker script.
* testsuite/ld-mips-elf/n64-plt.s: New test source.
* testsuite/ld-mips-elf/n64-plt-lib.s: New test source.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22966] n64 MIPS: -mplt -msym32 is resulting in assertion ld.orig: BFD 2.29.1 assertion fail binutils-2.29.1 /bfd/elfxx-mips.c:11234,
cvs-commit at gcc dot gnu.org <=