[U-Boot] ARM: Incorrect ROM protection range?

Albert ARIBAUD albert.aribaud at free.fr
Thu Feb 24 19:47:41 CET 2011


Le 24/02/2011 19:38, Wolfgang Denk a écrit :
> Dear Albert ARIBAUD,
>
> In message<4D6680E4.1070405 at free.fr>  you wrote:
>>
>> Do you mean a first commit to turn _end into _bss_end everywhere in
>> U-Boot, then a second commit to reintroduce _end and fix the issue with
>> monitor protection? Or even maybe a single commit for both?
>
> We should re-check if the current use of _end; excluding the linker
> scripts, I see these uses:
>
> arch/powerpc/cpu/74xx_7xx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/74xx_7xx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc512x/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc512x/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc5xx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc5xx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc5xxx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc5xxx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc8220/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc8220/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc824x/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc824x/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc8260/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc8260/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc83xx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc83xx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc85xx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc85xx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc86xx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc86xx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/mpc8xx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/mpc8xx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/cpu/ppc4xx/start.S:	GOT_ENTRY(_end)
> arch/powerpc/cpu/ppc4xx/start.S:	lwz	r4,GOT(_end)
> arch/powerpc/lib/board.c:extern ulong _end;
> arch/powerpc/lib/board.c:	len = (ulong)&_end - CONFIG_SYS_MONITOR_BASE;
> arch/arm/cpu/arm1136/start.S:	.word _end - _start
> arch/arm/cpu/arm1176/start.S:	.word _end - _start
> arch/arm/cpu/arm720t/start.S:	.word _end - _start
> arch/arm/cpu/arm920t/start.S:	.word _end - _start
> arch/arm/cpu/arm925t/start.S:	.word _end - _start
> arch/arm/cpu/arm926ejs/start.S:	.word _end - _start
> arch/arm/cpu/arm946es/start.S:	.word _end - _start
> arch/arm/cpu/arm_intcm/start.S:	.word _end - _start
> arch/arm/cpu/ixp/start.S:	.word _end - _start
> arch/arm/cpu/lh7a40x/start.S:	.word _end - _start
> arch/arm/cpu/pxa/start.S:	.word _end - _start
> arch/arm/cpu/s3c44b0/start.S:	.word _end - _start
> arch/arm/cpu/sa1100/start.S:	.word _end - _start
> arch/arm/cpu/armv7/start.S:	.word _end - _start
> arch/avr32/cpu/start.S:	lda.w	r9, _end
> arch/avr32/include/asm/sections.h:extern char _end[];
> arch/avr32/lib/board.c:		(unsigned long)_data, (unsigned long)_end);
> arch/avr32/lib/board.c:	monitor_len = _end - _text;
> arch/m68k/lib/board.c:extern ulong _end;
> arch/m68k/lib/board.c:	len = (ulong)&_end - CONFIG_SYS_MONITOR_BASE;
> arch/microblaze/cpu/start.S:	addi	r4, r0, __end
> arch/microblaze/cpu/start.S:	rsub	r4, r5, r4	/* size = __end - __text_start */
> arch/nios2/cpu/start.S:	 * and between __bss_start and _end.
> arch/nios2/cpu/start.S:	 movhi	r6, %hi(_end)
> arch/nios2/cpu/start.S:	 ori	r6, r6, %lo(_end)
> board/mousse/u-boot.lds.ram:  _end = . ;
> board/mousse/u-boot.lds.rom:  _end = . ;
> examples/standalone/stubs.c:extern unsigned long __bss_start, _end;
> examples/standalone/stubs.c:	while (cp<  (unsigned char *)&_end) {
>
> As far as I can tell, arch/powerpc/lib/board.c ,
> arch/avr32/lib/board.c and examples/standalone/stubs.c actually all
> mean __bss_end, as well as all the start.S files, so this seems to be
> consistently used at least.

I'd come to the same conclusion on my side. However you don't say how 
you would like the change to be done. Would a single commit for renaming 
_end into _bss_end and then creating _end after .dynsym be ok for you?

> Best regards,
>
> Wolfgang Denk

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list