On Mon, 5 Nov 2007 20:33:55 -0600 Nathan Lynch <[EMAIL PROTECTED]> wrote:
>
> static unsigned int count_relocs(const Elf32_Rela *rela, unsigned int num)
> {
> - unsigned int i, j, ret = 0;
> + unsigned int i, sorted_count = 0;
> + Elf32_Word last_info;
> + Elf32_Sword last_addend;
> + Elf32_Rela **sortbuf = NULL;
You don't need to initialise sortbuf and f you make it a "const
Elf32_Rela **" ...
> + sortbuf = vmalloc(num * sizeof(*sortbuf));
> + if (!sortbuf)
> + return -ENOMEM;
> +
> + for (i = 0; i < num; i++)
> + sortbuf[i] = (Elf32_Rela *)&rela[i];
You shouldn't need that cast.
> -static unsigned int count_relocs(const Elf64_Rela *rela, unsigned int num)
> +static int count_relocs(const Elf64_Rela *rela, unsigned int num)
> {
> unsigned int i, j, ret = 0;
> + Elf64_Xword last_info;
> + Elf64_Sxword last_addend;
> + Elf64_Rela **sortbuf = NULL;
Same here.
--
Cheers,
Stephen Rothwell [EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
pgpnW1xiF8YKl.pgp
Description: PGP signature
_______________________________________________ Linuxppc-dev mailing list [email protected] https://ozlabs.org/mailman/listinfo/linuxppc-dev
