Fix incorrect x32 overflow checking for refs to weak undef symbols.
authorCary Coutant <ccoutant@gmail.com>
Sun, 7 Feb 2016 06:42:16 +0000 (22:42 -0800)
committerCary Coutant <ccoutant@gmail.com>
Sun, 7 Feb 2016 15:49:34 +0000 (07:49 -0800)
commit7c8b700c92444fca9ee81ab3844baadac0bdd4e3
treed58a0a87a7878950547245d45b60ad134caad93e
parent30914ca8c030eedc4a7e1f1acc878211639cc1ca
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.

gold/
* x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
overflow checking when symbol value + addend < 0.
gold/ChangeLog
gold/x86_64.cc
This page took 0.025578 seconds and 4 git commands to generate.