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: Roland McGrath <roland at hack dot frob dot com>
- To: "Carlos O'Donell" <carlos at redhat 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 13:47:06 -0700 (PDT)
- 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>
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).