Subject: Re: --db_more-- in recent sparc64 kernel
To: None <petrov@netbsd.org>
From: None <eeh@netbsd.org>
List: port-sparc64
Date: 07/14/2001 00:13:31
| One which fails to start:
|
| netbsd:     file format elf64-sparc
| netbsd
| architecture: sparc:v9, flags 0x00000012:
| EXEC_P, HAS_SYMS
| start address 0x0000000001000000
|
| Program Header:
|     LOAD off    0x0000000000000080 vaddr 0x0000000001000000 paddr 0x0000000001000000 align 2**7
|          filesz 0x000000000041e7d8 memsz 0x0000000000499768 flags rwx

You haven't been looking at the linker errors, have you?

What has happened in this case is that your kernel and data segments have
collided.  This is a bad thing.

On sparc64 the kernel is mapped with 4MB pages that are locked into the
TLB.  To minimize wasteage, prevent overlap, etc. both the text segment
and the data segment are explicitly located at a 4MB aligned address by
the arguments passed to the linker.  Text is located at 0x0000000001000000
and data located at 0x0000000001400000.  When the text+rodata grows beyond
4MB, it collides with the data segment and lots of bad things happen.

The solution is to change the linker command to move the data segment over
to the next 4MB boundary.  It may make more sense to play with the linker
scripts and specify 4MB alignment for sections, that way the kernel could
grow without requiring changes to the link command, but that gets a bit
more complicated.

Eduardo