* JMPADD reloc in MIPS ECOFF file
@ 2005-03-01 17:49 Alexander Voropay
2005-03-04 14:11 ` Nick Clifton
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Voropay @ 2005-03-01 17:49 UTC (permalink / raw)
To: binutils
Hi!
Can anyone help me ? How to force MIPS binutils to emit an
ECOFF object file with JMPADDR relocs ?
I have an old MIPS-based X-Terminal, Tektronix TekXPress 338.
This device is based on the old MIPS VxWorks 5.0.4 (WIND 2.0 kernel).
I'm tryind to build an application with GCC/binutils.
As it is known, the VxWorks applications is just a "half-linked"
.o objects with undefined externals. The VxWorks itself
is a sort of huge ".so library". Never VxWorks versions are
using ELF, but my old version uses ECOFF.
http://tekxp-linux.hopto.org/pmwiki/pmwiki.php/Software/Toolchains
Unfortunately, built-in VxWork's `ld` accepts only REFHI, REFLO
and JMPADDR relocs but does not support for GPREL relocs while
the modern binutils emits GPREL.
I'm using a `objcopy` to convert from ELF to ECOFF.
How to make an ECOFF with JMPADDR relocs ?
$ mips-linux-gcc -O2 -mips1 -mno-half-pic -fno-pic -mno-abicalls -ffreestanding -c hellovx.c -o hellovx.elf
$ mips-linux-objcopy -O ecoff-bigmips hellovx.elf hellovx.ecoff
$ mips-linux-objdump -x hellovx.elf
...
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000004 R_MIPS_HI16 hello
00000008 R_MIPS_LO16 hello
00000014 R_MIPS_26 write
$ mips-linux-objdump -x hellovx.ecoff
...
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
0000000000000004 REFLO hello
0000000000000008 GPREL hello
0000000000000014 REFHI write
...
The R_MIPS_LO16 becames GPREL, but R_MIPS_26 --> REFHI ???
How it is possible ?
The binutils is 2.13.90.0.16 .
--
-=AV=-
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: JMPADD reloc in MIPS ECOFF file
2005-03-01 17:49 JMPADD reloc in MIPS ECOFF file Alexander Voropay
@ 2005-03-04 14:11 ` Nick Clifton
2005-03-11 13:23 ` Alexander Voropay
0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2005-03-04 14:11 UTC (permalink / raw)
To: Alexander Voropay; +Cc: binutils
Hi Alexander,
> Can anyone help me ? How to force MIPS binutils to emit an
> ECOFF object file with JMPADDR relocs ?
>
> As it is known, the VxWorks applications is just a "half-linked"
> .o objects with undefined externals. The VxWorks itself
> is a sort of huge ".so library". Never VxWorks versions are
> using ELF, but my old version uses ECOFF.
I think that the only way you are going to get what you want is to find
an old version of the VxWorks toolchain (for MIPS) and use that.
Cheers
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: JMPADD reloc in MIPS ECOFF file
2005-03-04 14:11 ` Nick Clifton
@ 2005-03-11 13:23 ` Alexander Voropay
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Voropay @ 2005-03-11 13:23 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
Hi!
>> Can anyone help me ? How to force MIPS binutils to emit an
>> ECOFF object file with JMPADDR relocs ?
> I think that the only way you are going to get what you want is to find
> an old version of the VxWorks toolchain (for MIPS) and use that.
I've built a binutils-2.15 with a just plain "./configure --target=mips-ecoff"
This makes a object files with JMPADDR as required by VxWorks loader!
$ /mips/binutils-2.15/binutils/objdump -i
BFD header file version 2.15
ecoff-bigmips
(header big endian, data big endian)
mips
ecoff-littlemips
(header little endian, data little endian)
mips
...
$ /mips//binutils-2.15/binutils/objdump -x /mips/app/hellovx/test.o
/mips/app/hellovx/test.o: file format ecoff-bigmips
/mips/app/hellovx/test.o
architecture: mips:3000, flags 0x00000031:
HAS_RELOC, HAS_SYMS, HAS_LOCALS
start address 0x00000000
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000030 00000000 00000000 000000f0 2**4
CONTENTS, ALLOC, LOAD, RELOC, CODE
1 .rdata 00000010 00000030 00000030 00000120 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .data 00000000 00000040 00000040 00000130 2**4
CONTENTS, ALLOC, LOAD, DATA
3 .bss 00000000 00000040 00000040 00000000 2**4
ALLOC
SYMBOL TABLE:
[ 0] e 00000000 st 0 sc 0 indx fffff entry
[ 1] e 00000000 st 1 sc 6 indx fffff printf
[ 3] l 00000000 st 5 sc 1 indx fffff entry
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000004 REFHI .rdata+0xffffffd0
00000008 REFLO .rdata+0xffffffd0
00000010 JMPADDR printf
--
-=AV=-
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-11 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 17:49 JMPADD reloc in MIPS ECOFF file Alexander Voropay
2005-03-04 14:11 ` Nick Clifton
2005-03-11 13:23 ` Alexander Voropay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).