This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]