This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: sh-elf Assembler doesn't give warning for misaligned data
- From: Nick Clifton <nickc at redhat dot com>
- To: Nutan at KPITCummins dot com
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 26 Nov 2003 17:33:48 +0000
- Subject: Re: sh-elf Assembler doesn't give warning for misaligned data
- References: <69595093233BB547BB70CF5E492B63F202D23F7D@sohm.kpit.com>
Hi Nutan,
> For code below, the sh-elf assembler doesn't give warning about
> misaligned data for "foo".
>
> .section .text
> mov.l foo, r0
> bar:
> .byte 1
> foo:
> .long 0x12345678
> The sh-coff assembler does give the warning.
Please try the attached patch and let me know if it gives you any
problems.
Cheers
Nick
2003-11-26 Nick Clifton <nickc@redhat.com>
* config/tc-sh.c (sh_elf_cons): If md_cons_align is defined
call it to make sure that the constants that are going to be
emitted are correctly aligned.
Index: gas/config/tc-sh.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.c,v
retrieving revision 1.88
diff -c -3 -p -r1.88 tc-sh.c
*** gas/config/tc-sh.c 22 Nov 2003 02:35:31 -0000 1.88
--- gas/config/tc-sh.c 26 Nov 2003 17:33:48 -0000
*************** sh_elf_cons (register int nbytes)
*** 801,806 ****
--- 801,810 ----
return;
}
+ #ifdef md_cons_align
+ md_cons_align (nbytes);
+ #endif
+
do
{
expression (&exp);