Article View: gnu.utils.bug
Article #1662A portability but in GNU ld in a cross-compiler environment
From: Jyrki Kuoppala
Date: Fri, 09 Jun 1989 04:44
Date: Fri, 09 Jun 1989 04:44
47 lines
1809 bytes
1809 bytes
Using the latest GNU ld on a sparc machine with the GNU linker
configured for a m68k target machine:
(gdb) r /usr/ressu/users/jkp/gcc-68k/gcc-crt0.o /usr/ressu/users/jkp/foo.o -lc
Starting program: /usr/ressu/users/jkp/tmp/bu/ld /usr/ressu/users/jkp/gcc-68k/gcc-crt0.o /usr/ressu/users/jkp/foo.o -lc
Program received signal 10, Bus error
Reading in symbols for ld.c...done.
perform_relocation (data=(char *) 0xfefff898 "#\300", pc_relocation=0, data_size=60, reloc_info=(struct relocation_info *) 0xfefff870, reloc_size=32, entry=(struct file_entry *) 0x1a7e8) (ld.c line 3981)
(gdb)
This is in the code in the following place:
break;
case 2:
if (RELOC_MEMORY_ADD_P(p))
=> relocation += mask & *(long *) (data + addr);
*(long *) (data + addr) &= ~mask;
*(long *) (data + addr) |= relocation;
break;
default:
fatal_with_file ("Unimplemented relocation field length in ", entry);
Some variables:
(gdb) print data
$1 = (char *) 0xfefff898 "#\300"
(gdb) print addr
$2 = 2
(gdb) print mask
$3 = 4294967295
(gdb) print relocation
$4 = 8132
(gdb)
So, it seems that on a Sparc you can't read a long except from a
longword-aligned address and on this cross-development configuration
alignment this would be needed.
All the programs were compiled with gcc 1.35.
I can provide more information if that's needed.
//Jyrki
Technical Details
Message-ID:
<8906090444.AA15787@cs.hut.fi>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!SAUNA.HUT.FI!jkpShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!SAUNA.HUT.FI!jkp From: jkp@SAUNA.HUT.FI (Jyrki Kuoppala) Newsgroups: gnu.utils.bug Subject: A portability but in GNU ld in a cross-compiler environment Message-ID: <8906090444.AA15787@cs.hut.fi> Date: 9 Jun 89 04:44:50 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: Helsinki University of Technology, Finland. Lines: 47