[PATCH] Allocate correct PLT reloc cache size during profiling and auditing.
Roland McGrath
roland@hack.frob.com
Mon Sep 22 20:47:00 GMT 2014
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).
More information about the Libc-alpha
mailing list