linux 0.01's boot.s has a assembler directive stating .align that is causing assembler to spit out error message... I can try to replace 3 with 4... the error go away... but based on the gas manual, .align 3 is a valid statement... was compiling in a vm ubuntu 64 bit machine...
thanks for the help...
.align 3 not working gnu as spits out errors
Re: .align 3 not working gnu as spits out errors
Are you trying to align to a multiple of 3 instad of a multiple of 8?
Re: .align 3 not working gnu as spits out errors
When using elf format, the default for gas nowadays, the argument to .align must be a power of 2. The behaviour is different when using a.out format (which that version of Linux would have used) where the argument specifies the power of 2.
So .align 3 (a.out) is equivalent to .align 8 (elf).
So .align 3 (a.out) is equivalent to .align 8 (elf).
Re: .align 3 not working gnu as spits out errors
Is there a way to choose zmagic/amagic over elf? What switch/flag is there? there doesn't seem to have any at first glance... just curious...
also by the same token, is .align 4 in a.out equivalent to .align 16 in elf?
also by the same token, is .align 4 in a.out equivalent to .align 16 in elf?
Re: .align 3 not working gnu as spits out errors
Try something like this (you'll likely need the object file, aout.o, already in a.out format, not ELF):ITchimp wrote:Is there a way to choose zmagic/amagic over elf? What switch/flag is there? there doesn't seem to have any at first glance... just curious...
Code: Select all
ld -e __start --oformat=a.out-i386 --omagic aout.o -o aout.out
ld -e __start --oformat=a.out-i386 --nmagic aout.o -o aout.out
ld -e __start --oformat=a.out-i386 --qmagic aout.o -o aout.out
I'd expect so.ITchimp wrote:also by the same token, is .align 4 in a.out equivalent to .align 16 in elf?
Re: .align 3 not working gnu as spits out errors
but don't forget, as always with this mess, - this is valid only for x86.iansjack wrote:When using elf format, the default for gas nowadays, the argument to .align must be a power of 2. The behaviour is different when using a.out format (which that version of Linux would have used) where the argument specifies the power of 2.
So .align 3 (a.out) is equivalent to .align 8 (elf).
for example on both arm, mips and ppc gccs emitting elf, .align 3 means "align on 2^3". which is sane imho.
Re: .align 3 not working gnu as spits out errors
For compatible behaviour across architectures use .balign.
Of course, Linux 0.01 only supported x86 processors.
Of course, Linux 0.01 only supported x86 processors.
Re: .align 3 not working gnu as spits out errors
I noted that just in case, for the OP, maybe he/she is going to develop not only on x86.iansjack wrote:For compatible behaviour across architectures use .balign.
Of course, Linux 0.01 only supported x86 processors.
I prefer the meaning where N in .align N means power of two. so .balign is BS. .p2align is better. of course if one wants to mess with gcc specific directives (which .balign an .p2align are).
Re: .align 3 not working gnu as spits out errors
I noted that just in case, for the OP, maybe he/she is going to develop not only on x86.iansjack wrote:For compatible behaviour across architectures use .balign.
Of course, Linux 0.01 only supported x86 processors.
I prefer the meaning where N in .align N means log2(alignment), not the alignment itself. so .balign is BS. .p2align is better. of course if one wants to mess with gcc specific directives (which .balign an .p2align are).