Subject: toolchain/23251: ld names wrong files
To: None <gnats-bugs@gnats.netbsd.org>
From: Martin Husemann <martin@aprisoft.de>
List: netbsd-bugs
Date: 10/23/2003 22:09:41
>Number:         23251
>Category:       toolchain
>Synopsis:       ld names wrong files
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 23 20:10:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Martin Husemann
>Release:        NetBSD 1.6ZD
>Organization:
>Environment:
System: NetBSD nelly.aprisoft.de 1.6ZD NetBSD 1.6ZD (NELLY) #22: Mon Oct 20 23:30:28 CEST 2003 martin@nelly.aprisoft.de:/usr/src/sys/arch/sparc64/compile/NELLY sparc64
Architecture: sparc64
Machine: sparc64
>Description:

When listing references to undefined symbols ld(1) uses wrong file names, if
source files of library modules use the same basename as the real source
file.

>How-To-Repeat:
Create a small test program with a typo in a function name. Safe it as "test.c".
Try to compile it. Watch the bogus ld error message:

[/tmp/emptydir] martin@nelly > pwd
/tmp/emptydir
[/tmp/emptydir] martin@nelly > ls -l
total 1
-rw-r--r--  1 martin  wheel  446 Oct 23 22:00 test.c
[/tmp/emptydir] martin@nelly > cc -g -Wall -O2 -pthread -lm test.c
test.c: In function `main':
test.c:20: warning: implicit declaration of function `phtread_create'
/var/tmp//ccRp4Xks.o: In function `main':
itimerspec/test.c:20: undefined reference to `phtread_create'


>Fix:
n/a
>Release-Note:
>Audit-Trail:
>Unformatted: