Subject: elf2ecoff problem

From: Jan-Benedict Glaw <[email-masked]>
Date: Sat, 24 Mar 2001 22:17:58 +0100

Hi!

I'm trying to get a bootable kernel from fridays CVS sources for a
R3k DECstation. The elf kernel compiles fine, but elf2ecoff fails:

make[1]: Entering directory `/home/jbglaw/kernel_src/work/mips_linux/linux/arch/mips/boot'
gcc -o elf2ecoff elf2ecoff.c
./elf2ecoff /home/jbglaw/kernel_src/work/mips_linux/linux/vmlinux vmlinux.ecoff -a
Non-contiguous data can't be converted.
make[1]: *** [vmlinux.ecoff] Error 1
make[1]: Leaving directory `/home/jbglaw/kernel_src/work/mips_linux/linux/arch/mips/boot'
make: *** [boot] Error 2

Any hints? I'm using binutils and gcc from simple/crossdev, but that
doesn't seem to be the problem here...

jbglaw@schaufenster:~/kernel_src/work/mips_linux/linux$ mipsel-linux-objdump -h vmlinux

vmlinux:     file format elf32-littlemips

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         00144590  ffffffff80040000  ffffffff80040000  00001000  2**13
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .fixup        000010f0  ffffffff80184590  ffffffff80184590  00145590  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .kstrtab      000031d4  ffffffff80185680  ffffffff80185680  00146680  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 __ex_table    00001fc0  ffffffff80188860  ffffffff80188860  00149860  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 __dbe_table   00000000  ffffffff8018a820  ffffffff8018a820  0014b820  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 __ksymtab     00001888  ffffffff8018a820  ffffffff8018a820  0014b820  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .text.init    0000dd78  ffffffff8018e000  ffffffff8018e000  0014e000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  7 .data.init    0000049c  ffffffff8019bd78  ffffffff8019bd78  0015bd78  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  8 .setup.init   00000088  ffffffff8019c220  ffffffff8019c220  0015c220  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  9 .initcall.init 00000058  ffffffff8019c2a8  ffffffff8019c2a8  0015c2a8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 10 .data.cacheline_aligned 00000200  ffffffff8019d000  ffffffff8019d000  0015d000  2**4
                  CONTENTS, ALLOC, LOAD, DATA
 11 .reginfo      00000018  ffffffff8019d200  ffffffff8019d200  0015d200  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_SAME_SIZE
 12 .data         00012890  ffffffff8019d220  ffffffff8019d220  0015d220  2**4
                  CONTENTS, ALLOC, LOAD, DATA
 13 .sbss         000002b8  ffffffff801afab0  ffffffff801afab0  0016fab0  2**3
                  ALLOC
 14 .bss          000259f0  ffffffff801afd70  ffffffff801afd70  0016fab8  2**4
                  ALLOC
 15 .mdebug       00084158  ffffffff801d5760  ffffffff801d5760  001700b8  2**2
                  CONTENTS, READONLY, DEBUGGING
 16 .note         00001720  ffffffff80271978  ffffffff80271978  001f4210  2**0
                  CONTENTS, READONLY
 17 .modinfo      00000018  ffffffff802730a0  ffffffff802730a0  001700a0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA

MfG, JBG

-- 
Fehler eingestehen, Größe zeigen: Nehmt die Rechtschreibreform zurück!!!
/* Jan-Benedict Glaw <[email-masked]> -- +49-177-5601720 */
keyID=0x8399E1BB fingerprint=250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB
     "insmod vi.o and there we go..." (Alexander Viro on linux-kernel)

---

From: Keith Owens <[email-masked]>
Date: Sun, 25 Mar 2001 09:21:56 +1000

On Sat, 24 Mar 2001 22:17:58 +0100, 
>                  CONTENTS, ALLOC, LOAD, READONLY, DATA

This may not be relevant but vmlinux should not have a .modinfo
section.  .modinfo is only created when code is compiled with -DMODULE
so why is it in vmlinux?

There was a recent change to the attributes of .modinfo, from CONTENTS,
READONLY to CONTENTS, ALLOC, LOAD, READONLY, DATA, this change was to
remove gcc warning messages.  insmod treats sections .modinfo and
.modstring as special cases and turns off the SHF_ALLOC flag, elf2ecoff
might need special processing for these sections.

---

From: Ralf Baechle <[email-masked]>
Date: Sun, 25 Mar 2001 05:35:54 +0200

> might need special processing for these sections.

The .modinfo section gets into vmlinux through drivers/tc/tc.o where it
gets created because include/asm-mips/dec/tcmodule.h defines the cpp
symbol MODULE; <linux/module.h> gets included after that and believing
this is a module compilation puts some stuff into .modinfo.

  Ralf

---

From: Keith Owens <[email-masked]>
Date: Mon, 26 Mar 2001 13:38:56 +1000

On Sun, 25 Mar 2001 05:35:54 +0200, 
>this is a module compilation puts some stuff into .modinfo.

tc will have to use a name other than MODULE, say TC_MODULE.

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 26 Mar 2001 19:19:04 +0200

> tc will have to use a name other than MODULE, say TC_MODULE.

I've now commited a fix to CVS.

  Ralf