Re: [Qemu-devel] [PATCH] exec: Don't request an address for code_gen_buffer if -fpie

2012-10-07 Thread Blue Swirl
On Sun, Oct 7, 2012 at 7:20 PM, Richard Henderson wrote: > On 10/07/2012 09:34 AM, Blue Swirl wrote: >>> > +#ifdef USE_MMAP >>> > +code_gen_buffer = mmap((void *)start, code_gen_buffer_size, >>> > + PROT_WRITE | PROT_READ | PROT_EXEC, >>> > +

Re: [Qemu-devel] [PATCH] exec: Don't request an address for code_gen_buffer if -fpie

2012-10-07 Thread Richard Henderson
On 10/07/2012 09:34 AM, Blue Swirl wrote: >> > +#ifdef USE_MMAP >> > +code_gen_buffer = mmap((void *)start, code_gen_buffer_size, >> > + PROT_WRITE | PROT_READ | PROT_EXEC, >> > + flags, -1, 0); >> > +if (code_gen_buffer == MAP_FAILED) { >

Re: [Qemu-devel] [PATCH] exec: Don't request an address for code_gen_buffer if -fpie

2012-10-07 Thread Blue Swirl
On Thu, Oct 4, 2012 at 9:31 PM, Richard Henderson wrote: > The hard-coded addresses inside code_gen_alloc only make sense if > we're building an executable that will actually run at the address > we've put into the linker scripts. > > When we're building with -fpie, the executable will run at some

[Qemu-devel] [PATCH] exec: Don't request an address for code_gen_buffer if -fpie

2012-10-04 Thread Richard Henderson
The hard-coded addresses inside code_gen_alloc only make sense if we're building an executable that will actually run at the address we've put into the linker scripts. When we're building with -fpie, the executable will run at some random location chosen by the kernel. We get better placement for