[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/18695] [x86-64] Missing relocation overflow check
From: |
ccoutant at gmail dot com |
Subject: |
[Bug gold/18695] [x86-64] Missing relocation overflow check |
Date: |
Sun, 07 Feb 2016 01:10:03 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=18695
--- Comment #10 from Cary Coutant <ccoutant at gmail dot com> ---
Created attachment 8963
--> https://sourceware.org/bugzilla/attachment.cgi?id=8963&action=edit
Patch to fix broken x32 overflow checks
Fix incorrect x32 overflow checking for refs to weak undef symbols.
On x32, a pc-relative reference to an undef weak symbol (value 0)
with a negative addend (typically -4) generates a spurious overflow
error because Symbol_value::value() returns a 32-bit negative number
as an unsigned number, which gets zero-extended before subtracting
the PC value. This patch fixes the problem by special-casing the
negative addend, and adding it to the value after widening it to
64 bits. Symbol_value::value() does not need the addend if it's
negative, since it is only important when processing section
symbols for merge sections, where a positive addend provides the
input section offset of the merged constant.
With this patch, I can build basic_static_pic_test in x32 mode.
HJ, I'd appreciate it if you could give it more testing before I
commit it.
2016-02-06 Cary Coutant <address@hidden>
gold/
* x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
overflow checking when symbol value + addend < 0.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/18695] [x86-64] Missing relocation overflow check, hjl.tools at gmail dot com, 2016/02/03
- [Bug gold/18695] [x86-64] Missing relocation overflow check, hjl.tools at gmail dot com, 2016/02/03
- [Bug gold/18695] [x86-64] Missing relocation overflow check, hjl.tools at gmail dot com, 2016/02/03
- [Bug gold/18695] [x86-64] Missing relocation overflow check, hjl.tools at gmail dot com, 2016/02/03
- [Bug gold/18695] [x86-64] Missing relocation overflow check, cvs-commit at gcc dot gnu.org, 2016/02/05
- [Bug gold/18695] [x86-64] Missing relocation overflow check, cvs-commit at gcc dot gnu.org, 2016/02/05
- [Bug gold/18695] [x86-64] Missing relocation overflow check, ccoutant at gmail dot com, 2016/02/05
- [Bug gold/18695] [x86-64] Missing relocation overflow check, hjl.tools at gmail dot com, 2016/02/06
- [Bug gold/18695] [x86-64] Missing relocation overflow check, hjl.tools at gmail dot com, 2016/02/06
- [Bug gold/18695] [x86-64] Missing relocation overflow check,
ccoutant at gmail dot com <=
- [Bug gold/18695] [x86-64] Missing relocation overflow check, hjl.tools at gmail dot com, 2016/02/07
- [Bug gold/18695] [x86-64] Missing relocation overflow check, cvs-commit at gcc dot gnu.org, 2016/02/07