This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld 2.15.94.0.2.2 : prohibited cross reference to a local symbol.
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Etienne Lorrain <etienne dot lorrain at masroudeau dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 29 Sep 2005 07:49:46 -0700
- Subject: Re: ld 2.15.94.0.2.2 : prohibited cross reference to a local symbol.
- References: <1851.192.168.201.6.1127987332.squirrel@pc300>
On Thu, Sep 29, 2005 at 10:48:52AM +0100, Etienne Lorrain wrote:
> I did some more experiment on this one, and the problem also exists
> in ld-2.16.1:
>
> [etienne@localhost linux-2.6.14-rc2-3]$ ../../projet/toolchain/bin/ld -v
> GNU ld version 2.16.1
>
> After my patch I have those symbols in the library:
> [etienne@localhost linux-2.6.14-rc2-3]$ readelf -s
> arch/i386/kernel/built-in.o | grep memcpy
> 493: 00000000 53 FUNC LOCAL DEFAULT 12 memcpy
> 1407: 00000000 0 NOTYPE GLOBAL DEFAULT UND memcpy
> 2077: 00000000 53 FUNC GLOBAL DEFAULT 12 code16_memcpy
>
> The Makefile tries to do a link with this command, I prepended the path
> to ld to get version 2.16.1 and I added the option "-y memcpy" to get
> more information:
> [etienne@localhost linux-2.6.14-rc2-3]$ ../../projet/toolchain/bin/ld -m
> elf_i386 -o .tmp_vmlinux1 -T arch/i386/kernel/vmlinux.lds
> arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/built-in.o
> --start-group usr/built-in.o arch/i386/kernel/built-in.o
> arch/i386/mm/built-in.o arch/i386/mach-default/built-in.o
> arch/i386/crypto/built-in.o kernel/built-in.o mm/built-in.o
> fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o
> lib/lib.a arch/i386/lib/lib.a lib/built-in.o arch/i386/lib/built-in.o
> drivers/built-in.o sound/built-in.o arch/i386/pci/built-in.o
> arch/i386/power/built-in.o net/built-in.o --end-group -y memcpy
> arch/i386/kernel/built-in.o: reference to memcpy
> kernel/built-in.o: reference to memcpy
> mm/built-in.o: reference to memcpy
> fs/built-in.o: reference to memcpy
> crypto/built-in.o: reference to memcpy
> arch/i386/lib/lib.a(memcpy.o): definition of memcpy
> drivers/built-in.o: reference to memcpy
> net/built-in.o: reference to memcpy
> arch/i386/kernel/built-in.o: In function `pentium3_get_frequency':
> speedstep-lib.c:(.text+0xf720): prohibited cross reference from .text to
> `memcpy' in .realmode
> [etienne@localhost linux-2.6.14-rc2-3]$
>
> So it seems that ld tries to link with the first "memcpy" symbol
> it finds in the library, ignoring that the first one is local and
> only the second one is a global "memcpy" symbol.
>
> Is there something more I can do to get that fixed - or am I
> totally wrong?
Please open a bug report with a small testcase.
H.J.