Bug 110493 - ld doesn't error on unresolved symbol.
ld doesn't error on unresolved symbol.
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-20 01:21 EST by Ralph Loader
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-10 18:00:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralph Loader 2003-11-20 01:21:51 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):

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 18:00:09 EDT
Can't reproduce with either binutils-2.15.91.0.2-8 or binutils-2.15.90.0.3-5.

Note You need to log in before you can comment on or make changes to this bug.