Re: trouble with 2.6.6
On Mon, 7 Jun 2004, Meelis Roos wrote:
> CTS> I tried to boot 2.6.6 on my amiga and my mac. Besides some drivers which did
> CTS> not want to (cross) compile, like ide-scsi, apne, I could not get it to
> CTS> work. The mac had a problem with backwards seeking when loading the kernel,
> CTS> I think I read something about this here before. Has there been a solution,
> CTS> ie some fix in the binutils or something? I didn't find this again with
> CTS> google...
>
> Some binutils (or gcc?) change caused the order of segments in vmlinux
> to change from being sorted by address. This breaks Penguin. No known
> progress on this one, neither from finding out what binutils/gcc change
> broke it nor from fixing penguin to work with these kind on binaries.
It's binutils. But it's not simply the order.
I compiled an (experimental, of course :-) uClinux 2.6.6 kernel using gcc
3.3.3 (Debian 20040321) and binutils 2.14.90.0.7 (20031029), both generated
from Debian's toolchain-source, and I suffered from the same problem. Amiboot
aborts with:
| The kernel will be located at 0x00200000
| \ 638976 file Unsupported backward seek in module file (bufstart=622592,| dstpost=0)
| Failed to seek to segment 2
However, if I use m68k-linux-ld from binutils 2.9.5.0.37 to perform the final
linking step of vmlinux, I can boot the kernel fine under UAE (until it hangs
later due to an unrelated reason):
| The kernel will be located at 0x00200000
| \ 638976 file
|
| Bootstrap's bootinfo version: 2.0
| Kernel's bootinfo version : 2.0
| Kernel segment 0 at 0x201000, size 627620
| Kernel segment 1 at 0x29a3b0, size 56400
| ramdisk dest is 0x00a00000
| ramdisk lower limit is 0x00322522
| ramdisk src top is 0x00322522
m68k-linux-objdump says:
| vmlinux-binutils-2.9.5.0.37: file format elf32-m68k
|
| Sections:
| Idx Name Size VMA LMA File off Algn
| 0 .text 0007848c 00201000 00201000 00001000 2**2
| CONTENTS, ALLOC, LOAD, READONLY, CODE
| 1 __ex_table 00000f08 00279490 00279490 00079490 2**2
| CONTENTS, ALLOC, LOAD, READONLY, DATA
| 2 .rodata 0000973f 0027a398 0027a398 0007a398 2**1
| CONTENTS, ALLOC, LOAD, READONLY, DATA
| 3 __ksymtab 00000000 00283ad7 00283ad7 0009c000 2**0
| CONTENTS
| 4 __ksymtab_gpl 00000000 00283ad7 00283ad7 0009c000 2**0
| CONTENTS
| 5 __kcrctab 00000000 00283ad7 00283ad7 0009c000 2**0
| CONTENTS
| 6 __kcrctab_gpl 00000000 00283ad7 00283ad7 0009c000 2**0
| CONTENTS
| 7 .data 00009df0 00283ad8 00283ad8 00083ad8 2**2
| CONTENTS, ALLOC, LOAD, DATA
| 8 .bss 0000cad4 0028d8d0 0028d8d0 0008d8d0 2**4
| ALLOC
| 9 .data.cacheline_aligned 00000000 0029a3b0 0029a3b0 0008e3b0 2**4
| CONTENTS, ALLOC, LOAD, DATA
| 10 .init.text 0000793a 0029b000 0029b000 0008f000 2**1
| CONTENTS, ALLOC, LOAD, CODE
| 11 .init.data 000013aa 002a293a 002a293a 0009693a 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 12 .init.setup 000000b0 002a3cf0 002a3cf0 00097cf0 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 13 .initcall.init 0000007c 002a3da0 002a3da0 00097da0 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 14 .con_initcall.init 00000008 002a3e1c 002a3e1c 00097e1c 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 15 .security_initcall.init 00000000 002a3e24 002a3e24 0009c000 2**0
| CONTENTS
| 16 .init.ramfs 00000086 002a4000 002a4000 00098000 2**0
| CONTENTS, ALLOC, LOAD, READONLY, DATA
| 17 .data.init_task 00002000 002a6000 002a6000 0009a000 2**13
| CONTENTS, ALLOC, LOAD, DATA
| 18 .comment 00001cf8 00000000 00000000 0009c000 2**0
| CONTENTS, READONLY
| 19 .note.GNU-stack 00000000 00000000 00000000 0009dcf8 2**0
| CONTENTS, READONLY, CODE
|
|
| vmlinux-binutils-2.14.90.0.7: file format elf32-m68k
|
| Sections:
| Idx Name Size VMA LMA File off Algn
| 0 .text 0007848c 00201000 00201000 00001000 2**2
| CONTENTS, ALLOC, LOAD, READONLY, CODE
| 1 __ex_table 00000f08 00279490 00279490 00079490 2**2
| CONTENTS, ALLOC, LOAD, READONLY, DATA
| 2 .rodata 0000926e 0027a398 0027a398 0007a398 2**1
| CONTENTS, ALLOC, LOAD, READONLY, DATA
| 3 __ksymtab 00000000 00283606 00283606 0009c000 2**0
| CONTENTS
| 4 __ksymtab_gpl 00000000 00283606 00283606 0009c000 2**0
| CONTENTS
| 5 __kcrctab 00000000 00283606 00283606 0009c000 2**0
| CONTENTS
| 6 __kcrctab_gpl 00000000 00283606 00283606 0009c000 2**0
| CONTENTS
| 7 .data 00009df0 00283608 00283608 00083608 2**2
| CONTENTS, ALLOC, LOAD, DATA
| 8 .bss 0000cad4 0028d400 0028d400 0008d400 2**4
| ALLOC
| 9 .data.cacheline_aligned 00000000 00299ee0 00299ee0 0008dee0 2**4
| CONTENTS, ALLOC, LOAD, DATA
| 10 .init.text 0000793a 0029a000 0029a000 0008e000 2**1
| CONTENTS, ALLOC, LOAD, READONLY, CODE
| 11 .init.data 000013aa 002a193a 002a193a 0009593a 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 12 .init.setup 000000b0 002a2cf0 002a2cf0 00096cf0 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 13 .initcall.init 0000007c 002a2da0 002a2da0 00096da0 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 14 .con_initcall.init 00000008 002a2e1c 002a2e1c 00096e1c 2**1
| CONTENTS, ALLOC, LOAD, DATA
| 15 .security_initcall.init 00000000 002a2e24 002a2e24 0009c000 2**0
| CONTENTS
| 16 .init.ramfs 00000086 002a4000 002a4000 00098000 2**0
| CONTENTS, ALLOC, LOAD, READONLY, DATA
| 17 .data.init_task 00002000 002a6000 002a6000 0009a000 2**13
| CONTENTS, ALLOC, LOAD, DATA
| 18 .comment 00001cf8 00000000 00000000 0009c000 2**0
| CONTENTS, READONLY
| 19 .note.GNU-stack 00000000 00000000 00000000 0009dcf8 2**0
| CONTENTS, READONLY, CODE
I recalculated the VMAs and offsets manually, but didn't see anything fishy :-(
(638976 = 0x9c000, 622592 = 0x9c000)
Note that I don't load vmlinux directly, but convert it to a ucimage first,
using:
| m68k-linux-objcopy \
| --change-section-vma .text-0x00200000 \
| --change-section-vma __ex_table-0x00200000 \
| --change-section-vma .rodata-0x00200000 \
| --change-section-vma __ksymtab-0x00200000 \
| --change-section-vma __ksymtab_gpl-0x00200000 \
| --change-section-vma __kcrctab-0x00200000 \
| --change-section-vma __kcrctab_gpl-0x00200000 \
| --change-section-vma .data-0x00200000 \
| --change-section-vma .bss-0x00200000 \
| --change-section-vma .data.cacheline_aligned-0x00200000 \
| --change-section-vma .init.text-0x00200000 \
| --change-section-vma .init.data-0x00200000 \
| --change-section-vma .init.setup-0x00200000 \
| --change-section-vma .initcall.init-0x00200000 \
| --change-section-vma .con_initcall.init-0x00200000 \
| --change-section-vma .security_initcall.init-0x00200000 \
| --change-section-vma .init.ramfs-0x00200000 \
| --change-section-vma .data.init_task-0x00200000 \
| vmlinux ucimage
BTW, anyone who knows a simple way to have multiple toolchain versions created
using Debian's toolchain-source on your system? So I can have e.g. both
linux-m68k-gcc-3.2 and linux-m68k-gcc-3.3.3? Right now I have 3.2 (with working
binutils) on my old Vaio, and 3.3.3 (with non-working binutils) on my new
Athlon.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Reply to: