Re: Simulator bootloader fails with gcc 4

Stephane Eranian
2005-08-19T23:43:15Z

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

Peter,

>
>
> .bss
> .align 16
> stack_mem:
> .skip 16834
>
> GLOBAL_ENTRY(_start)
> .prologue
> .save rp, r0
> .body
> movl gp = __gp
> movl sp = stack_mem
> bsw.1
> br.call.sptk.many rp=start_bootloader
> END(_start)
>
> Doesn't the stack grow downwards on IA64? Shouldn't that be something
> like:

The memory stack grows down, the RBS grows up.

>
> .bss
> .align 16
> rbs_mem:
> skip 18384-16
> stack_mem:
> skip 16
>
> ????
>
Ok, this change seems to work for both gcc-4.0 and gcc-3.3.5. So what this is saying
is that we got lucky with the older compilers that the variables were somehow laid out
slightly differently on the stack.

> I can't run ski at present to check it (it segfaults immediately)
>
Well, that will be the next thing I need to check. It dies on both IA64 and I386?

The attached patch fixes the bootloader problem for me.

--

-Stephane

[-- Attachment #2: bootloader-050819.diff --]
[-- Type: text/plain, Size: 307 bytes --]

--- arch/ia64/hp/sim/boot/boot_head.S.orig 2005-08-19 16:40:20.000000000 -0700
+++ arch/ia64/hp/sim/boot/boot_head.S 2005-08-19 16:40:25.000000000 -0700
@@ -7,8 +7,10 @@

.bss
.align 16
+rbs_mem:
+ .skip 18384-16
stack_mem:
- .skip 16834
+ .skip 16

.text