Subject: objcopy error -- was RE: your mail

From: John Van Horne <[email-masked]>
Date: Thu, 4 Jan 2001 12:08:25 -0800

Is there anyway to get more information out of objcopy?  When I run it,
I get the warnings I mentioned before, but no errors, however the target
file is empty.  Here is an abridged copy of what I get:

[jvhorne@guava-lx linux]$ make orionboot
make -C arch/mips/orion orionboot
make[1]: Entering directory
`/dvlp/jvhorne/jvh_21_lx_mips_cross_test_sv/vobs/gpl/linux/arch/mips/orion'
mips-linux-objcopy -Obinary --verbose ../../../vmlinux orion.nosym
copy from ../../../vmlinux(elf32-bigmips) to orion.nosym(binary)
BFD: Warning: Writing section `.app_header' to huge (ie negative) file
offset 0x800fec30.
BFD: Warning: Writing section `.text' to huge (ie negative) file offset
0x80100c30.
BFD: Warning: Writing section `.fixup' to huge (ie negative) file offset
0x80236930.
BFD: Warning: Writing section `.text.exit' to huge (ie negative) file offset
0x80237830.
.
.
.
mips-linux-objcopy: orion.nosym: File truncated

Do you think that the reason objcopy fails is because it isn't treating
the addresses as 32 bit addresses, or could it be something else?

Thanks,
-John

-----Original Message-----
From: Maciej W. Rozycki [mailto:[email-masked]]
Sent: Thursday, January 04, 2001 8:23 AM
To: Ralf Baechle
Cc: John Van Horne; [email-masked]'; [email-masked]'
Subject: Re: your mail

On Thu, 4 Jan 2001, Ralf Baechle wrote:

> > I see that our start address of 0x80102584 has been turned into
> > 0xffffffff80102584. I'm thinking that
> > I need to tell ld something to stop it from doing this. Any ideas?
> 
> That's be ok.  32-bit MIPS addresses are sign-extended into 64-bit
addresses.
> Older binutils used to zero-extend addresses which was broken.  So what
> you observe is actually the sympthom of a bug that got fixed.

 I'm not sure that's the best solution, I'm afraid.  For elf32-mips
addresses should be 32-bit and not 64-bit.  It would be consistent with
other 32-bit platforms, it would make interoperability easier (ksymoops
cannot make use of System.map to grok kernel oopses which provide 32-bit
addresses) and it would make objdump outputs more readable.

 Fixing this problem with BFD is on my to do list (but has a low priority
assigned). 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email-masked], PGP key available        +

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Thu, 4 Jan 2001 22:17:33 +0100 (MET)

> the addresses as 32 bit addresses, or could it be something else?

 Note that the binary BFD target fills all "holes" with zeroes.  I suspect
one or more sections are placed at an offset lower than 0x80000000. 
Objcopy would have to make a huge file in this case and it gives up.  You
probably need to fix your linker script.