[PATCH] Allocate correct PLT reloc cache size during profiling and auditing.

Carlos O'Donell carlos@redhat.com
Mon Sep 22 23:09:00 GMT 2014


On 09/22/2014 04:47 PM, Roland McGrath wrote:
> I didn't contemplate the substance.
> 
>> +	size_t sizeofrel;
>> +	size_t relcount;
> 
> Don't predeclare when C99-style mixed decls are fine.
> 
>>  	  {
>>  	    errstring = N_("%s: no PLTREL found in object %s\n");
>> @@ -279,8 +281,12 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
>>  			      l->l_name);
>>  	  }
>>  
>> -	l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]),
>> -				    l->l_info[DT_PLTRELSZ]->d_un.d_val);
>> +	sizeofrel = l->l_info[DT_PLTREL]->d_un.d_val == DT_RELA
>> +		    ? sizeof(ElfW(Rela))
>> +		    : sizeof(ElfW(Rel));
> 
> Missing spaces before paren (after sizeof, but not after ElfW).
> 

Thanks. I'll change that and commit later if nobody else objects.

Cheers,
Carlos.



More information about the Libc-alpha mailing list