Re: [Qemu-devel] [PATCH 07/12] linux-user: Load symbols from the interpreter.

2010-07-28 Thread Edgar E. Iglesias
On Tue, Jul 27, 2010 at 10:25:33AM -0700, Richard Henderson wrote: > First, adjust load_symbols to accept a load_bias parameter. At the same > time, read the entire section header table in one go, use pread instead > f lseek+read for the symbol and string tables, and properly free > allocated stru

Re: [Qemu-devel] [PATCH 07/12] linux-user: Load symbols from the interpreter.

2010-07-27 Thread malc
On Wed, 28 Jul 2010, malc wrote: > On Tue, 27 Jul 2010, Richard Henderson wrote: > > > On 07/27/2010 11:45 AM, malc wrote: > > >> +syms = realloc(syms, nsyms * sizeof(*syms)); > > > > > > Realloc can fail here. > > > > I don't believe it can. This (pre-existing) statement *reduces* > > the

Re: [Qemu-devel] [PATCH 07/12] linux-user: Load symbols from the interpreter.

2010-07-27 Thread malc
On Tue, 27 Jul 2010, Richard Henderson wrote: > On 07/27/2010 11:45 AM, malc wrote: > >> +syms = realloc(syms, nsyms * sizeof(*syms)); > > > > Realloc can fail here. > > I don't believe it can. This (pre-existing) statement *reduces* > the existing allocation of syms. I'd be surprised if a

Re: [Qemu-devel] [PATCH 07/12] linux-user: Load symbols from the interpreter.

2010-07-27 Thread Richard Henderson
On 07/27/2010 11:45 AM, malc wrote: >> +syms = realloc(syms, nsyms * sizeof(*syms)); > > Realloc can fail here. I don't believe it can. This (pre-existing) statement *reduces* the existing allocation of syms. I'd be surprised if any malloc implementation fails on a size reduction. That sai

Re: [Qemu-devel] [PATCH 07/12] linux-user: Load symbols from the interpreter.

2010-07-27 Thread malc
On Tue, 27 Jul 2010, Richard Henderson wrote: > First, adjust load_symbols to accept a load_bias parameter. At the same > time, read the entire section header table in one go, use pread instead > f lseek+read for the symbol and string tables, and properly free > allocated structures on error exit

[Qemu-devel] [PATCH 07/12] linux-user: Load symbols from the interpreter.

2010-07-27 Thread Richard Henderson
First, adjust load_symbols to accept a load_bias parameter. At the same time, read the entire section header table in one go, use pread instead f lseek+read for the symbol and string tables, and properly free allocated structures on error exit paths. Second, adjust load_elf_interp to compute load

[Qemu-devel] [PATCH 07/12] linux-user: Load symbols from the interpreter.

2010-05-05 Thread Richard Henderson
First, adjust load_symbols to accept a load_bias parameter. At the same time, read the entire section header table in one go, use pread instead f lseek+read for the symbol and string tables, and properly free allocated structures on error exit paths. Second, adjust load_elf_interp to compute load