[Bug ld/1396] New: prohibited cross reference to a local symbol.

2005-09-30 Thread etienne dot lorrain at masroudeau dot com
LD is trying to link to the wrong (local) memcpy symbol when executing
those commands:

[EMAIL PROTECTED]:~$ cat /proc/version
Linux version 2.6.12-1-k7 ([EMAIL PROTECTED]) (gcc version 4.0.2 20050821 
(prerelease) (Debian 4.0.1-6)) #1 Tue Sep 6 16:28:10 UTC 2005
[EMAIL PROTECTED]:~$ ld --version
GNU ld version 2.16.91 20050902 Debian GNU/Linux
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
[EMAIL PROTECTED]:~$ mkdir tmp
[EMAIL PROTECTED]:~$ cd tmp
[EMAIL PROTECTED]:~/tmp$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-
2.6.13.2.tar.bz2
[EMAIL PROTECTED]:~/tmp$ wget 'http://marc.theaimsgroup.com/?l=linux-
kernel&m=112557274910448&q=p3' -O patch2613-1
[EMAIL PROTECTED]:~/tmp$ wget 'http://marc.theaimsgroup.com/?l=linux-
kernel&m=112557274923346&q=p3' -O patch2613-2
# NOTE: the previous patches have been produced with RedHat Fedora Core 3
# and so lack a newline at end of the file, it will apply cleanly on
# Fedora core 3 but not on Debian, so just do:
[EMAIL PROTECTED]:~/tmp$ echo >> patch2613-1
[EMAIL PROTECTED]:~/tmp$ echo >> patch2613-2
[EMAIL PROTECTED]:~/tmp$ tar xjf linux-2.6.13.2.tar.bz2
[EMAIL PROTECTED]:~/tmp$ cd linux-2.6.13.2
[EMAIL PROTECTED]:~/tmp/linux-2.6.13.2$ patch -p1 < ../patch2613-1
[EMAIL PROTECTED]:~/tmp/linux-2.6.13.2$ patch -p1 < ../patch2613-2
[EMAIL PROTECTED]:~/tmp/linux-2.6.13.2$ make defconfig
[EMAIL PROTECTED]:~/tmp/linux-2.6.13.2$ make vmlinux > log
.
arch/i386/kernel/built-in.o: In function `smp_store_cpu_info':
: prohibited cross reference from .text to `memcpy' in .realmode
make: *** [.tmp_vmlinux1] Error 1
[EMAIL PROTECTED]:~/tmp/linux-2.6.13.2$ readelf -s arch/i386/kernel/built-in.o 
| 
grep memcpy
   351: 65 FUNCLOCAL  DEFAULT   12 memcpy
  1077:  0 NOTYPE  GLOBAL DEFAULT  UND memcpy
  1720: 65 FUNCGLOBAL DEFAULT   12 code16_memcpy
[EMAIL PROTECTED]:~/tmp/linux-2.6.13.2$ make vmlinux
  CHK include/linux/version.h
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
  CHK include/linux/compile.h
  CHK usr/initramfs_list
  GEN .version
  CHK include/linux/compile.h
  UPD include/linux/compile.h
  CC  init/version.o
  LD  init/built-in.o
  LD  .tmp_vmlinux1
arch/i386/kernel/built-in.o: In function `smp_store_cpu_info':
: prohibited cross reference from .text to `memcpy' in .realmode
make: *** [.tmp_vmlinux1] Error 1
# NOTE: line extracted from a verbose build: " make vmlinux V=1 "
# and add manually the -y memcpy
[EMAIL PROTECTED]:~/tmp/linux-2.6.13.2$ ld -m elf_i386 -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/oprofile/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
arch/i386/lib/lib.a(memcpy.o): definition of memcpy
drivers/built-in.o: reference to memcpy
sound/built-in.o: reference to memcpy
net/built-in.o: reference to memcpy
arch/i386/kernel/built-in.o: In function `smp_store_cpu_info':
: prohibited cross reference from .text to `memcpy' in .realmode


  Thanks,
  Etienne.

-- 
   Summary: prohibited cross reference to a local symbol.
   Product: binutils
   Version: 2.16
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: etienne dot lorrain at masroudeau dot com
CC: bug-binutils at gnu dot org
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=1396

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: ld overwriting output sections???

2005-09-30 Thread Nick Clifton

Hi Jakub,

the kernel image is linked together correctly (line is present) or the 
.mapped section overwrites the .unmapped section (line is not present).


When you say that it overwrites are you referring to the load-time 
address (LMA) or the run-time address (VMA) or both ?



Is there anything wrong with our linking process or is it a bug in ld?


It does sound like a ld problem.  Have you tried using the latest 
sources from the CVS repository ?  They may work.  If not, please could 
you put together a small test program (assembler source, linker script, 
makefile) that demonstrates the problem so that we can investigate further ?


 .mapped (((0x10 +0x8000) + 0x8000)+SIZEOF(.unmapped)): AT 
(0x8000 +SIZEOF(.unmapped)) {


Presumably this line is the culprit, and at a guess I would assume that 
the SIZEOF() operator is not working properly.


Cheers
  Nick



___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: binutils and libiberty.h

2005-09-30 Thread Nick Clifton

Hi Pierre,


I just compiled without problem binutils 2.16.1.
But I noticed that the 'make install' didn't install the 'libiberty.h' 
file which is needed by some other apps.
I would like to know if this is a normal situation or if I have 
misunderstood some things.


It is probably the normal situation.  If you run an explicit "make 
install-libiberty" do you get the header file installed ?


Cheers
  Nick




___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: [Bug binutils/1391] New: objcopy trashes PE executable when using "add-gnu-debuglink"

2005-09-30 Thread Nick Clifton

Hi,


Idx Name  Size  VMA   LMA   File off  Algn
  0 .gnu_debuglink 0018      0268  2**2



When using a native win32 "PE" editor/format tool like "LordPE" it lists some
crap for the first section (containing debug link), all other sections seem ok:



Seems objcopy is messing up the PE section table while adding gnu debug link.


I seem to recall that the PE file format does not allow sections to 
start at address 0 and that this causes problems for debug sections.


Probably the simplest way to fix this problem is to amend the PE linker 
script (ld/scripttempl/pe.sc) and add an explicit entry for the 
.gnu_debuglink section.


If this works, please could you submit a patch so that we can apply it 
to the mainline sources.


Cheers
  Nick




___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/1391] objcopy trashes PE executable when using "add-gnu-debuglink"

2005-09-30 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2005-09-30 15:25 
---
Subject: Re:  New: objcopy trashes PE executable when using
 "add-gnu-debuglink"

Hi,

> Idx Name  Size  VMA   LMA   File off  Algn
>   0 .gnu_debuglink 0018      0268  2**2

> When using a native win32 "PE" editor/format tool like "LordPE" it lists some
> crap for the first section (containing debug link), all other sections seem 
> ok:

> Seems objcopy is messing up the PE section table while adding gnu debug link.

I seem to recall that the PE file format does not allow sections to 
start at address 0 and that this causes problems for debug sections.

Probably the simplest way to fix this problem is to amend the PE linker 
script (ld/scripttempl/pe.sc) and add an explicit entry for the 
.gnu_debuglink section.

If this works, please could you submit a patch so that we can apply it 
to the mainline sources.

Cheers
   Nick




-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1391

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Is this a ld bug?

2005-09-30 Thread Nick Clifton

Hi Vamsi,

hidden symbol `__dso_handle' in 
/usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/crtbegin.o is referenced by DSO

collect2: ld returned 1 exit status

is this a bug in binutils 2.14 ??


Almost certainly yes.  Please try building a new linker using the 
current latest released sources (version 2.16) or, even better, the 
current CVS mainline sources.


If you still have this problem using the new linker please could you 
generate and submit a small test case so that we can investigate further.


Cheers
  Nick




___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/1396] prohibited cross reference to a local symbol.

2005-09-30 Thread hjl at lucon dot org

--- Additional Comments From hjl at lucon dot org  2005-10-01 04:40 ---
Created an attachment (id=682)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=682&action=view)
A testcase

With this testcase on Linux/x86, I get

bash-3.00$ make
gcc -m32-c -o foo.o foo.c
gcc -m32-c -o x.o x.c
gcc -m32-c -o y.o y.c
ld -m elf_i386 -r -o lib.o x.o y.o
gcc -m32-c -o z.o z.c
gcc -m32 -o foo foo.o lib.o z.o -Wl,-T,elf_i386.x
lib.o: In function `bar':
: prohibited cross reference from .text to `foo' in .foo
collect2: ld returned 1 exit status
make: *** [foo] Error 1


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1396

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils