This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ppc32: Building tiny executable


Hi there,

I am toying with a tiny executable:

$ cat tiny.c
#include <unistd.h>
void _start() {
  _exit(42);
}

on x86-64, here is what I get:

$ gcc -static -ffreestanding -nostartfiles  -s -o tiny tiny.c
$ ./tiny || echo $?

Now from a ppc32 system:

$ 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 ?

Thanks,
-- 
Mathieu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]