4 ms·
Using main as entry point might not be the best option, as that way some initialization code is skipped and for instance not even the program arguments will be
by Vogtinator 4y ago
Using main as entry point might not be the best option, as that way some initialization code is skipped and for instance not even the program arguments will be easily accessible. Instead, using _start from crt1.o should be the better option:
gcc -fPIC -shared -o test test.c -Wl,--entry,_start -D 'PT_INTERP="/lib64/ld-linux-x86-64.so.2"' /usr/lib64/crt1.o
- intelVISA 4y agoUsing main as the entry point is unthinkable!