This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
sh64 partial link not resolving datalabel refs
- From: "Clarke, Stephen" <stephen dot clarke at superh dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Tue, 16 Jul 2002 16:03:30 -0700
- Subject: sh64 partial link not resolving datalabel refs
We have a problem when trying to do a partial link for
sh64 target.
Here's a cut-down example:
$ cat x.s
.data
.global xxx
xxx: .long 1, 2, 3
$ cat y.s
.data
.global yyy
yyy:
.long datalabel xxx
$ sh64-elf-as -abi=32 -isa=shmedia -o x.o x.s
$ ar r libx.a x.o
$ sh64-elf-as -abi=32 -isa=shmedia -o y.o y.s
$ sh64-elf-ld -mshelf32 -r y.o -L. -lx -o y
$ sh64-elf-nm y
U xxx
00000000 D yyy
The problem is that xxx remains undefined after the
partial link, but it should have been pulled in from libx.a.
The problem only occurs when the "datalabel" operator is used.
The misbehaviour appears to be because during a partial link,
symbols marked STT_DATALABEL are simply renamed on input,
e.g. "xxx" is renamed "xxx DL" (in bfd/elf32-sh64.c,
sh64_elf_add_symbol_hook). This does not match the
name in the definition (in x.o in libx.a), and so x.o
is not added to the link. "xxx DL" remains unresolved, and
on output it is renamed back to "xxx".
I'd like to work out a fix for this, but I'm really
not sure what to do: I can't see how this partial link
behaviour is supposed to work.
Any hints or ideas would be most welcome.
Steve.