/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS...

版权声明:转载请注明出处,谢谢。 https://blog.csdn.net/butterfly5211314/article/details/84592397

gcc执行报错:

$ gcc oobrecv.c
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in /tmp/cccdLepY.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status

原因:

extern int errno;

extern int errno;修改为#include <errno.h>就好了。

参考:
https://www.linuxquestions.org/questions/programming-9/errno-tls-definition-in-lib64-libc-so-6-section-tbss-mismatches-non-tls-reference-528681/

欢迎补充指正!

猜你喜欢

转载自blog.csdn.net/butterfly5211314/article/details/84592397
TLS