This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: sh-elf Assembler doesn't give warning for misaligned data


Hi Nick,

Thank you for the solution. Given patch works well. Now, SH-ELF generates proper warning message for misaligned data.

Regards,
Nutan

-----Original Message-----
From: Nick Clifton [mailto:nickc@redhat.com]
Sent: Wednesday, November 26, 2003 11:04 PM
To: Nutan
Cc: binutils@sources.redhat.com
Subject: Re: sh-elf Assembler doesn't give warning for misaligned data


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);
        


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]