PIC/PIE issue on Nios2

Romain Naour romain.naour@gmail.com
Sun Jun 6 09:56:04 GMT 2021


Hello,

Le 28/05/2021 à 10:01, Florian Weimer a écrit :
> * Romain Naour via Libc-alpha:
> 
>> Analyzing one of the binary with strace show that the problem occur
>> very early when starting the new process:
>>
>>  # strace ./busybox
>>  execve("./busybox", ["./busybox"], 0x7f91ce90 /* 10 vars */) = -1 ENOMEM
>> (Cannot allocate memory)
>>  +++ killed by SIGSEGV +++
>>
>> I tried with several binutils/glibc/gcc version without any success.
>>
>> Is PIE is really supported for Nios2 architecture ?
> 
> If the kernel cannot execve the executable at all, that looks more like
> a linker problem.  It could also be a kernel bug, of course.  (Address
> space layout is architecture-specific.)
> 
> There is PIE and statically linked PIE.  The latter should be supported
> on all targets.  Statically linked PIE requires toolchain changes and a
> little bit of architecture-specific code in glibc.

I don't know about the status of required toolchain changes for statically
linked PIE for NiosII. The statically linked PIE option (--enable-static-pie) is
not used to build the toolchain so (as you said) it look like a linker problem
or kernel bug.

I tried with the latest kernel version without success.

For now, the PIC/PIE Buildroot option has been disabled for NiosII.

Best regards,
Romain


> 
> Thanks,
> Florian
> 



More information about the Libc-alpha mailing list