Summary: | Invalid R_X86_64_GOTPCREL -> R_X86_64_PC32 conversions | ||
---|---|---|---|
Product: | binutils | Reporter: | H.J. Lu <hjl.tools> |
Component: | ld | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ccoutant, jsweval, rafael |
Priority: | P2 | ||
Version: | 2.26 | ||
Target Milestone: | 2.26 | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
H.J. Lu
2015-06-24 11:25:38 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=59cab532835904f368b0aa99267afba5fda5ded2 commit 59cab532835904f368b0aa99267afba5fda5ded2 Author: H.J. Lu <hjl.tools@gmail.com> Date: Wed Jun 24 10:13:55 2015 -0700 Don't convert R_X86_64_GOTPCREL if it will overflow When converting "mov foo@GOTPCREL(%rip), %reg" to "lea foo(%rip), %reg" with R_X86_64_PC32 relocation, it may overflow if the target section is more than 2GB away. This patch estimates distance between mov instruction and the target section. We convert R_X86_64_GOTPCREL to R_X86_64_PC32 only if their distance is less than 2GB. PR ld/18591 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation overflow. This bug is still present in gold (In reply to Rafael Ávila de Espíndola from comment #2) > This bug is still present in gold See PR 18609 and PR 18695. The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6ba2af251c40aea2483b3c9666667af364e68495 commit 6ba2af251c40aea2483b3c9666667af364e68495 Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Feb 2 06:36:52 2016 -0800 Add a testcase for PR ld/18591 PR ld/18591 * testsuite/ld-x86-64/pr18591.d: New file. * testsuite/ld-x86-64/pr18591.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr18591. The binutils-2_26-branch branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=48953bf4f8b2f9e257903efbc89cb927b43f5317 commit 48953bf4f8b2f9e257903efbc89cb927b43f5317 Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Feb 2 06:36:52 2016 -0800 Add a testcase for PR ld/18591 Backport from master PR ld/18591 * testsuite/ld-x86-64/pr18591.d: New file. * testsuite/ld-x86-64/pr18591.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr18591. |