Subject: Re: objcopy making a mess of converting kernels to a.out format
To: None <port-arm@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: port-arm
Date: 03/01/2004 02:54:21
On Sun, Feb 29, 2004 at 22:37:12 +0000, Richard Earnshaw wrote:

> As I mentioned previously, I suspect that the link_... sections are 
> somehow not being fully taken into account -- I suspect that the problem 
> only occurs if something like the following is true
> 
> 	(0x20 + sizeof(.text)) & ~0xfff
> 	 < (0x20 + sizeof(.text) + sizeof(link_*)) & ~0xfff
> 
> In the particular case in question it was a custom kernel for my cats 
> which booted fine until I made an unrelated change (to build a kernel with 
> WD_DUMP_NOT_TRUSTED defined) -- the resulting kernel crashes immediately 
> on boot before it can even print out the NetBSD banner.

Oh, that sounds suspiciously familiar:

RCS file: /cvsroot/src/sys/arch/netwinder/conf/kern.ldscript,v

revision 1.3
date: 2003/06/11 21:49:40;  author: uwe;  state: Exp;  lines: +4 -4
Avoid using SIZEOF to compute output section LMAs, it doesn't mix well
with orphaned sections like link_set_*.  Per discussion with Jason
Thorpe <thorpej@netbsd> on tech-toolchain.

Addresses kern/21844.

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen