From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Nathan Lynch <ntl@pobox.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [RFC/PATCH] reduce load time for modules with lots of relocs
Date: Tue, 6 Nov 2007 15:29:57 +1100 [thread overview]
Message-ID: <20071106152957.63fcbf9f.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20071106023355.GJ9695@localdomain>
[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]
On Mon, 5 Nov 2007 20:33:55 -0600 Nathan Lynch <ntl@pobox.com> 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 sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-11-06 4:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-01 23:34 Module with 36K relocation entries Medve Emilian-EMMEDVE1
2007-11-01 23:57 ` Nathan Lynch
2007-11-06 2:33 ` [RFC/PATCH] reduce load time for modules with lots of relocs Nathan Lynch
2007-11-06 4:29 ` Stephen Rothwell [this message]
2007-11-06 23:58 ` Medve Emilian
2007-11-07 1:19 ` Nathan Lynch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071106152957.63fcbf9f.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=ntl@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox