This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: Switch Linux/mips to stabs


On 11 Jun 2001, Ian Lance Taylor wrote:

> > Jason Thorpe in the NetBSD camp was able to persuade binutils to
> > generate bootable MIPS ECOFF kernels via objcopy.  If objcopy indeed
> > works, it would be nice to see elf2ecoff go away.  :)
> > 
> > The patch to BFD is here:
> > 
> > http://mail-index.netbsd.org/port-mips/2001/06/07/0001.html
> 
> Yes, I spoke with Jason about this.  The basic problem is that the
> ECOFF writer does the wrong thing for Jason's purposes if D_PAGED is
> set, and there is no way to directly control whether the ELF backend
> sets D_PAGED or not.  Jason's patch arranges for the ELF backend to
> not set D_PAGED in the particular case that he needs, but that is a
> trifle odd.  I don't have time to look into this, but it seems to me
> that there must be some clean way to get the ELF backend to not set
> D_PAGED.  Anybody want to look into it?

 I'm not sure objcopy is the right tool here -- while the tool is right
for converting between binary formats, it's not the one to modify
binaries' internals.  The desired effect can be achieved with ld, which
indeed is the right tool here:

$ cat test.s
        .globl  __start
__start:

$ mipsel-linux-as -o test.o test.s

$ file test.o
test.o: ELF 32-bit LSB relocatable, MIPS R3000_BE - invalid byte order,
version 1, not stripped

$ mipsel-linux-objdump -f test.o
test.o:     file format elf32-littlemips
architecture: mips:3000, flags 0x00000010:
HAS_SYMS
start address 0x0000000000000000

$ mipsel-linux-ld -m mipslit -o test test.o

$ file test
test: MIPSEL-LE COFF executable (paged) not stripped - version 0.0

$ mipsel-linux-objdump -f test
test:     file format ecoff-littlemips
architecture: mips:3000, flags 0x00000132:
EXEC_P, HAS_SYMS, HAS_LOCALS, D_PAGED
start address 0x0000000000400120

$ mipsel-linux-ld -N -m mipslit -o test test.o

$ file test
test: MIPSEL-LE COFF executable (impure) not stripped - version 0.0

$ mipsel-linux-objdump -f test
test:     file format ecoff-littlemips
architecture: mips:3000, flags 0x00000032:
EXEC_P, HAS_SYMS, HAS_LOCALS
start address 0x0000000000400120

It seems to work as it should.  And that's with default ld scripts.  I
can't run-time test it, unfortunately, as my DECstation's firmware doesn't
grok TFTP for any of my network devices and MOP uses raw binary format
instead of COFF for booting.

 That said we could certainly support -[Nn] for ELF as well. 

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]