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]

PATCH, xcoff gas line numbers


The is a gas patch for fixing 2 xcoff line number problems.

First, fixes fixes the problem of setting the .bi line number before a .bf is
seen. 

Second, fixes the incorrect use of the x_endndx field for C_FCN symbols,  XCOFF
doesn't use them.

Tom
 
-- 
Tom Rix 
GCC Engineer
trix@redhat.com
256.704.9201
2001-09-24  Tom Rix <trix@redhat.com>

	* config/tc-ppc (ppc_bf, ppc_biei) : Set first .bi lineno value to 
	location of next .bf
	* config/obj-coff.c (coff_frob_symbol) : XCOFF does not use endndx.

diff -rc src-old/src/gas/config/obj-coff.c src/src/gas/config/obj-coff.c
*** src-old/src/gas/config/obj-coff.c	Sun Sep 23 19:42:52 2001
--- src/src/gas/config/obj-coff.c	Sun Sep 23 19:48:47 2001
***************
*** 1309,1314 ****
--- 1309,1315 ----
        set_end = next_set_end;
      }
  
+ #ifndef OBJ_XCOFF
    if (! *punt
        && S_GET_STORAGE_CLASS (symp) == C_FCN
        && strcmp (S_GET_NAME (symp), ".bf") == 0)
***************
*** 1317,1323 ****
  	SA_SET_SYM_ENDNDX (coff_last_bf, symp);
        coff_last_bf = symp;
      }
! 
    if (coffsymbol (symbol_get_bfdsym (symp))->lineno)
      {
        int i;
--- 1318,1324 ----
  	SA_SET_SYM_ENDNDX (coff_last_bf, symp);
        coff_last_bf = symp;
      }
! #endif
    if (coffsymbol (symbol_get_bfdsym (symp))->lineno)
      {
        int i;
Only in src/src/gas/config: obj-coff.c.orig
diff -rc src-old/src/gas/config/tc-ppc.c src/src/gas/config/tc-ppc.c
*** src-old/src/gas/config/tc-ppc.c	Sun Sep 23 19:42:55 2001
--- src/src/gas/config/tc-ppc.c	Sun Sep 23 19:52:44 2001
***************
*** 3167,3173 ****
  }
  
  /* The .bf pseudo-op.  This is just like a COFF C_FCN symbol named
!    ".bf".  */
  
  static void
  ppc_bf (ignore)
--- 3167,3176 ----
  }
  
  /* The .bf pseudo-op.  This is just like a COFF C_FCN symbol named
!    ".bf".  If the pseudo op .bi was seen before .bf, patch the .bi sym
!    with the correct line number */
!  
! static symbolS *saved_bi_sym = 0;
  
  static void
  ppc_bf (ignore)
***************
*** 3186,3191 ****
--- 3189,3202 ----
    S_SET_NUMBER_AUXILIARY (sym, 1);
    SA_SET_SYM_LNNO (sym, coff_line_base);
  
+   /* line number for bi */
+   if (saved_bi_sym) 
+     {
+       S_SET_VALUE (saved_bi_sym, coff_n_line_nos);
+       saved_bi_sym = 0;
+     }
+   
+ 
    symbol_get_tc (sym)->output = 1;
  
    ppc_frob_label (sym);
***************
*** 3219,3225 ****
  
  /* The .bi and .ei pseudo-ops.  These take a string argument and
     generates a C_BINCL or C_EINCL symbol, which goes at the start of
!    the symbol list.  */
  
  static void
  ppc_biei (ei)
--- 3230,3237 ----
  
  /* The .bi and .ei pseudo-ops.  These take a string argument and
     generates a C_BINCL or C_EINCL symbol, which goes at the start of
!    the symbol list.  The value of .bi will be know when the next .bf
!    is encountered.  */
  
  static void
  ppc_biei (ei)
***************
*** 3248,3253 ****
--- 3260,3271 ----
  
    S_SET_STORAGE_CLASS (sym, ei ? C_EINCL : C_BINCL);
    symbol_get_tc (sym)->output = 1;
+ 
+   /* save bi */
+   if (ei) 
+     saved_bi_sym = 0;
+   else
+     saved_bi_sym = sym;
  
    for (look = last_biei ? last_biei : symbol_rootP;
         (look != (symbolS *) NULL


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