no padding at all
Christian Groessler
cpg@aladdin.de
Thu Jan 14 13:46:00 GMT 1999
Hello,
I've build a crosscompiler for alpha-linuxelf, hosted on i486-pc-linux.
I understand that running a compiler for a 64bit target on a 32bit host
may (will?) give suboptimal optimization. But now I've encountered a
problem, I think it's a bug(tm):
This file
/*--------*/
char *labels[] = {
"beef",
"babe",
"cafe",
"zap!"
};
/*--------*/
compiles to the following, when compiled on the alpha:
(with an older egcs version, parameters: gcc -O2 -S stralign.c -o
stralign.s)
---------
.file 1 "stralign.c"
.version "01.01"
.set noat
gcc2_compiled.:
__gnu_compiled_c:
.globl labels
.data
.align 3
.type labels,@object
labels:
.quad $LC0
.quad $LC1
.quad $LC2
.quad $LC3
.section .rodata
.align 3
$LC3:
.ascii "zap!\0"
.align 3
$LC2:
.ascii "cafe\0"
.align 3
$LC1:
.ascii "babe\0"
.align 3
$LC0:
.ascii "beef\0"
.size labels,32
.ident "GCC: (GNU) egcs-2.90.29 980515 (egcs-1.0.3 release)"
---------
Please note the "align 3" btw. the strings.
Now, compiled on the intel host for target alpha:
---------
.file 1 "stralign.c"
.set noat
.set noreorder
.globl labels
.data
.align 3
.type labels,@object
labels:
.quad $LC0
.quad $LC1
.quad $LC2
.quad $LC3
.section .rodata
$LC3:
.ascii "zap!\0"
$LC2:
.ascii "cafe\0"
$LC1:
.ascii "babe\0"
$LC0:
.ascii "beef\0"
.size labels,32
.ident "GCC: (GNU) egcs-2.91.60 19981201 (egcs-1.1.1 release)"
---------
So there is no alignment at all!
Am I to expect such behaviour, or went something wrong when
I configured/built the crosscompiler?
thanks for your help
chris
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.
More information about the crossgcc
mailing list