On 2020/11/28 12:26, helmut karlowski wrote: > Hi, > > when I compile > > #include <stdio.h> > void main(void) > { > printf( "test\\n" ); > } > > wich gcc --static t.c (gcc (GCC) 8.4.0), the resulting a.out does crash: > > $a.out > Memory fault (core dumped)
The above output with "Memory fault" doesn't look like it comes from OpenBSD. That test does fail with ports GCC on OpenBSD, but with "Segmentation fault". > In fact it is not really static: > > $ldd a.out > a.out: > Start End Type Open Ref GrpRef Name > 1a52f000 3a537000 exe 1 0 0 a.out > 0302c000 0302c000 ld.so 0 1 0 /usr/libexec/ld.so OpenBSD compilers use PIE by default, this is normal for a PIE binary.