This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Allocate correct PLT reloc cache size during profiling and auditing.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Matthew LeGendre <legendre1 at llnl dot gov>, Ben Woodard <woodard at redhat dot com>
- Date: Mon, 22 Sep 2014 19:08:56 -0400
- Subject: Re: [PATCH] Allocate correct PLT reloc cache size during profiling and auditing.
- Authentication-results: sourceware.org; auth=none
- References: <54206A25 dot 5060909 at redhat dot com> <20140922204706 dot E91842C245E at topped-with-meat dot com>
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.