public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* PIC/PIE issue on Nios2
@ 2021-05-27 22:21 Romain Naour
  2021-05-28  8:01 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Romain Naour @ 2021-05-27 22:21 UTC (permalink / raw)
  To: GNU C Library

Hello,

The Buildroot project now generate Position-Independent Code (PIC) and link
Position-Independent Executables (PIE) by default.

This add -fPIE or -pie flag at compile/link time while building the toolchain
and the rootfs.

On Nios2 architecture this produce non working executable crashing the system
while starting the init process.

Run /init as init process
  with arguments:
    /init
  with environment:
    HOME=/
    TERM=linux
Failed to execute /init (error -12)

See: Buildroot build log and Qemu runtime test log in build artifacts:
https://gitlab.com/buildroot.org/buildroot/-/jobs/1285145889

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 ?

Best regards,
Romain

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-06  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 22:21 PIC/PIE issue on Nios2 Romain Naour
2021-05-28  8:01 ` Florian Weimer
2021-06-06  9:56   ` Romain Naour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).