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)

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


On linux (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0) I get:

$ldd a.out
        not a dynamic executable


With the old gcc4 it used to work. Is it a bug or am I missing something?

-Helmut




Reply via email to