Red Hat Bugzilla – Bug 110493
ld doesn't error on unresolved symbol.
Last modified: 2007-11-30 17:10:33 EST
Description of problem:
Linking a shared library with -z defs or -no-undefined is only giving
a warning on undefined symbols, not an error.
Even explicitly adding --error-unresolved-symbols doesn't help either.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
$ cat temp.c void bar();
$ gcc -shared -o temp.so -Wl,-z,defs temp.c
/tmp/ccCHVPSU.o(.text+0x7): In function `foo':
: warning: undefined reference to `bar'
$ echo $?
The return code from the linker was 0.
The return code should be non-zero.
This wasn't broken in RedHat 9.
Can't reproduce with either binutils-220.127.116.11.2-8 or binutils-18.104.22.168.3-5.