compiler gives error ld terminated with signal 11

2019-07-22 14:52发布

问题:

I am trying to compile a simple hello program using gcc, but getting the below error. i am using ubuntu.

gcc -g -o hello hello.c

collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped compilation terminated.

strace ld -v

execve("/usr/bin/ld", ["ld", "-v"], 0x7ffc43b744c8 /* 57 vars */) = 0 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x2} --- +++ killed by SIGSEGV (core dumped) +++ Segmentation fault (core dumped)

I tried reinstalling gcc and binutils, didn't work.