Bug 110493

Summary: ld doesn't error on unresolved symbol.
Product: [Fedora] Fedora Reporter: Ralph Loader <suckfish>
Component: binutilsAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-10 22:00:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ralph Loader 2003-11-20 06:21:51 UTC
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):

binutils-2.14.90.0.6-3

How reproducible:

Every time.

Steps to Reproduce:

$ cat temp.c void bar();
void foo()
{
  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 $?
0

  
Actual results:

The return code from the linker was 0.

Expected results:

The return code should be non-zero.

Additional info:

This wasn't broken in RedHat 9.

Comment 1 Jakub Jelinek 2004-10-10 22:00:09 UTC
Can't reproduce with either binutils-2.15.91.0.2-8 or binutils-2.15.90.0.3-5.