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-22.214.171.124.2-8 or binutils-126.96.36.199.3-5.