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: [PATCH][GOLD] Treat R_ARM_PREL31 as a function call in Target_arm::Scan::get_reference_flags


An R_ARM_PREL31 relocation can point to a personality routine that is
called during unwinding.  If the personality routine is not in the
output, we need to generate a PLT.

-Doug

On Wed, Dec 8, 2010 at 7:01 AM, Richard Sandiford
<richard.sandiford@linaro.org> wrote:
> "Doug Kwan (éæå)" <dougkwan@google.com> writes:
>> Index: gold/arm.cc
>> ===================================================================
>> RCS file: /cvs/src/src/gold/arm.cc,v
>> retrieving revision 1.128
>> diff -u -u -p -r1.128 arm.cc
>> --- gold/arm.cc    11 Nov 2010 10:43:30 -0000   Â1.128
>> +++ gold/arm.cc    8 Dec 2010 02:07:24 -0000
>> @@ -7646,7 +7646,6 @@ Target_arm<big_endian>::Scan::get_refere
>> Â Â Âcase elfcpp::R_ARM_THM_MOVW_BREL:
>> Â Â Âcase elfcpp::R_ARM_GOTOFF32:
>> Â Â Âcase elfcpp::R_ARM_GOTOFF12:
>> - Â Âcase elfcpp::R_ARM_PREL31:
>> Â Â Âcase elfcpp::R_ARM_SBREL31:
>> Â Â Â Âreturn Symbol::RELATIVE_REF;
>>
>> @@ -7659,6 +7658,10 @@ Target_arm<big_endian>::Scan::get_refere
>> Â Â Âcase elfcpp::R_ARM_THM_JUMP6:
>> Â Â Âcase elfcpp::R_ARM_THM_JUMP11:
>> Â Â Âcase elfcpp::R_ARM_THM_JUMP8:
>> + Â Â// R_ARM_PREL31 is not used to relocate call/jump instructions but
>> + Â Â// in unwind tables. It may point to functions via PLTs.
>> + Â Â// So we treat it like call/jump relocations above.
>> + Â Âcase elfcpp::R_ARM_PREL31:
>> Â Â Â Âreturn Symbol::FUNCTION_CALL | Symbol::RELATIVE_REF;
>>
>> Â Â Âcase elfcpp::R_ARM_GOT_BREL:
>
> Hmm, I see this matches BFD's behaviour, but it isn't what I'd expect
> from the EABI. ÂSpecifically, FUNCTION_CALL is defined as:
>
> Â Â// A reference that can always be treated as a function call.
> Â ÂFUNCTION_CALL = 8
>
> and it isn't clear (to me) from the EABI that _all_ R_ARM_PREL31s can
> be treated as function calls. ÂThe EABI says that R_ARM_PREL31 is a
> general static data relocation, like R_ARM_ABS*, instead.
>
> Richard
>


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