On Thu, Oct 14, 2010 at 01:50:36AM +0200, Tobias Ulmer wrote:
> I'm currently loading the kernel at a fixed start address using u-boot.
> There's no relocation going on.
> Accessing anything in the data segment leads to crashes due to file- and
> address offsets desyncing.
> 
> The patch below fixes this issue and, as a bonus, syncs the code with
> the comment.
> Possibly affected are armish, beagle, gumstix, palm and zaurus
> 
> Index: arch/arm/conf/ldscript.tail
> ===================================================================
> RCS file: 
> /srv/boron/data/vcs/cvs/openbsd/src/sys/arch/arm/conf/ldscript.tail,v
> retrieving revision 1.4
> diff -u -p -r1.4 ldscript.tail
> --- arch/arm/conf/ldscript.tail       27 Jun 2009 14:44:39 -0000      1.4
> +++ arch/arm/conf/ldscript.tail       13 Oct 2010 23:17:30 -0000
> @@ -5,7 +5,7 @@
>    PROVIDE (etext = .);
>    /* Adjust the address for the data segment to start on the next page
>       boundary.  */
> -  . = ALIGN(0x8000);
> +  . = ALIGN(0x1000);
>    .data    :
>    AT (LOADADDR(.text) + (ADDR(.data) - ADDR(.text)))
>    {
> 

How are you loading the kernel with u-boot? 

When I was doing this in the past, I was doing the following
$ ${OBJCOPY} -O binary bsd bsd.img
$ mkuboot -a arm -o linux -e ${KERNEL_BASE_PHYS} -l ${KERNEL_BASE_PHYS} bsd.img 
bsd.umg

This method had no problem with the current 'alignment'

I thought I recalled that the ldscript aligned the pages on 64k boundaries,
but that does not appear to be the case. Not certian why 32k would be 
desireable.
Will look into this more.

Dale Rahn                               dr...@dalerahn.com

Reply via email to