public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Simulator bootloader fails with gcc 4
@ 2005-07-20  5:31 Ian Wienand
  2005-07-20 22:34 ` James E Wilson
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Ian Wienand @ 2005-07-20  5:31 UTC (permalink / raw)
  To: linux-ia64

Hi,

After building a fresh tree with gcc 4 I can't boot the simulator as
the bootloader loader dies with 

loading /home/ianw/kerntest/kerncomp//build/sim_defconfig/vmlinux...
failed to read phdr

After some investigation I believe this is do with differences between
the alignment of variables on the stack between gcc 3 and 4 and the
ski simulator.  If you trace through with the simulator you can see
that the disk_stat structure value returned from the
SSC_WAIT_COMPLETION call seems to be only half loaded.  I guess it
doesn't like the alignment of the input.  I confirmed that things do
get aligned differently thusly :

ianw@lime:/tmp$ cat test.c
#include <stdio.h>

struct disk_stat {
        int fd;
        unsigned count;
};

int main(void)
{
        int blah;
        struct disk_stat test;

        printf("%p\n", &test);
}
ianw@lime:/tmp$ gcc-3.4 -o test test.c
ianw@lime:/tmp$ ./test
0x60000fffffc2f480
ianw@lime:/tmp$ gcc-4.0 -o test test.c
ianw@lime:/tmp$ ./test
0x60000fffff813484

The patch below at least fixes it for me.

Thanks,

-i

Signed-Off-By: Ian Wienand <ianw@gelato.unsw.edu.au>

--

diff --git a/arch/ia64/hp/sim/boot/bootloader.c b/arch/ia64/hp/sim/boot/bootloader.c
--- a/arch/ia64/hp/sim/boot/bootloader.c
+++ b/arch/ia64/hp/sim/boot/bootloader.c
@@ -33,7 +33,7 @@ struct disk_req {
 struct disk_stat {
 	int fd;
 	unsigned count;
-};
+} __attribute__ ((aligned (16)));
 
 extern void jmp_to_kernel (unsigned long bp, unsigned long e_entry);
 extern struct ia64_boot_param *sys_fw_init (const char *args, int arglen);

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2005-08-22 22:16 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-20  5:31 Simulator bootloader fails with gcc 4 Ian Wienand
2005-07-20 22:34 ` James E Wilson
2005-07-22  4:58 ` Ian Wienand
2005-07-22  6:00 ` david mosberger
2005-08-15  1:49 ` Ian Wienand
2005-08-16 22:46 ` Luck, Tony
2005-08-18  0:53 ` Ian Wienand
2005-08-18 13:25 ` Stephane Eranian
2005-08-18 18:57 ` Luck, Tony
2005-08-18 19:07 ` Stephane Eranian
2005-08-18 23:14 ` Peter Chubb
2005-08-18 23:41 ` Stephane Eranian
2005-08-18 23:58 ` Peter Chubb
2005-08-19 11:33 ` Stephane Eranian
2005-08-19 23:13 ` Peter Chubb
2005-08-19 23:43 ` Stephane Eranian
2005-08-19 23:55 ` Peter Chubb
2005-08-22 13:00 ` Gerald Pfeifer
2005-08-22 22:16 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox