Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5952

linux, ld command by --entry option generate segment fault error

$
0
0

When I execute the following command to make an executable, It is ok

ld -o xxx a.o -lc -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /usr/lib/x86_64-linux-gnu/crtn.o

But, when I add --entry option like the following, the executable is made, but when I execute the executable I got Segmentation fault (core dumped) error.

 ld -o xxx a.o -lc -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /usr/lib/x86_64-linux-gnu/crtn.o --entry=main

The platform is gcc-14.1.0 and Ubuntu 22.04.4 LTS


Viewing all articles
Browse latest Browse all 5952

Trending Articles