[PATCH] ldso/ARC: fix DT_RELACOUNT handling

Vineet Gupta Vineet.Gupta1 at synopsys.com
Fri May 20 08:26:13 UTC 2016


On Friday 20 May 2016 12:57 PM, Khem Raj wrote:
> On Thu, May 19, 2016 at 11:56 PM, Vineet Gupta
> <Vineet.Gupta1 at synopsys.com> wrote:
>> From: Cupertino Miranda <cmiranda at synopsys.com>
>>
>> Wih new bintuils supporting DT_RELACOUNT, ldso was crashing as it was
>> parsing relocs incorrectly.
>>
>> Apparently that code ran for first time and was never tested.
>>
>> Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
>> ---
>>  ldso/ldso/arc/dl-sysdep.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/ldso/ldso/arc/dl-sysdep.h b/ldso/ldso/arc/dl-sysdep.h
>> index b6bda9d14691..caece997d254 100644
>> --- a/ldso/ldso/arc/dl-sysdep.h
>> +++ b/ldso/ldso/arc/dl-sysdep.h
>> @@ -166,7 +166,7 @@ static __always_inline void
>>  elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
>>                       Elf32_Word relative_count)
>>  {
>> -        Elf32_Rel * rpnt = (void *) rel_addr;
>> +        Elf32_Rela * rpnt = (void *) rel_addr;
> This is ok

Is this is question - ARC is a rela ABI and this fell thru cracks as it was not
being exercised at all due to lack of DT_RELACOUNT support in binutils so far.

>
>>         --rpnt;
>>         do {
>>                 Elf32_Addr *const reloc_addr = (void *) (load_off + (++rpnt)->r_offset);
>> --
>> 2.5.0
>>
>> _______________________________________________
>> uClibc mailing list
>> uClibc at uclibc.org
>> http://lists.busybox.net/mailman/listinfo/uclibc



More information about the uClibc mailing list