Bug 110493 - ld doesn't error on unresolved symbol.
Summary: ld doesn't error on unresolved symbol.
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
(Show other bugs)
Version: 1
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-20 06:21 UTC by Ralph Loader
Modified: 2007-11-30 22:10 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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.


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