Re: ppc32: Building tiny executable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 04, 2018 at 01:45:35PM +0200, Mathieu Malaterre wrote:
> $ gcc -static -ffreestanding -nostartfiles  -s -o tiny tiny.c
> $ ./tiny
> Segmentation fault
> 
> What do I need to pay attention to on ppc to build tiny executable
> using the _start function ?

You need to set up r13.  This is powerpc64?  (32-bit works fine for me,
but you may be using a different ABI, you didn't tell.  I'm on Linux).

You also should align r1 and set up a terminating stack frame, and set
LR to 0.  Look what glibc does :-)


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux