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]

v850 .offset patch


The v850 port is not handling the .offset pseudo-op correctly.

Here is a simple example:
        .text
	and     r0,r0
	.offset 0x10
	and     r1,r1
	.offset 0x20
	and     r2,r2
If I assemble this with -a, I get
   2 0000 4001     		and     r0,r0
   3 0002 00000000 		.offset 0x10
     ...
   4 0012 4109     		and     r1,r1
   5 0014 00000000 		.offset 0x20
     ...
   6 0034 4211     		and     r2,r2

Note that the offset pseudo-ops added 0x10/0x20 bytes of padding respectively,
instead of moving . to 0x10/0x20 as documented.  This patch fixes the problem
by using frag_var.

Now I get the expected result as per the documentation
   2 0000 4001     	        and     r0,r0
   3 0002 00000000 	        .offset 0x10
     ...
   4 0010 4109     	        and     r1,r1
   5 0012 00000000 	        .offset 0x20
     ...
   6 0020 4211     	        and     r2,r2

There are no testsuite regressions, but then there probably aren't any .offset
testcases.  I have checked this in.

2002-09-26  Jim Wilson  <wilson@redhat.com>

	* config/tc-v850.c (v850_offset): Use frag_var instead of frag_now_fix
	and frag_more.

Index: tc-v850.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.c,v
retrieving revision 1.26
diff -p -r1.26 tc-v850.c
*** tc-v850.c	5 Sep 2002 00:01:18 -0000	1.26
--- tc-v850.c	26 Sep 2002 21:20:35 -0000
*************** static void
*** 193,204 ****
  v850_offset (ignore)
       int ignore ATTRIBUTE_UNUSED;
  {
    int temp = get_absolute_expression ();
! 
!   temp -= frag_now_fix ();
! 
!   if (temp > 0)
!     (void) frag_more (temp);
  
    demand_empty_rest_of_line ();
  }
--- 193,204 ----
  v850_offset (ignore)
       int ignore ATTRIBUTE_UNUSED;
  {
+   char *pfrag;
    int temp = get_absolute_expression ();
!    
!   pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, (symbolS *)0,
!                        (offsetT) temp, (char *) 0);
!   *pfrag = 0;
  
    demand_empty_rest_of_line ();
  }


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