Fix for gas seg fault and neg line numbers
authorTom Rix <trix@redhat.com>
Thu, 24 May 2001 21:39:09 +0000 (21:39 +0000)
committerTom Rix <trix@redhat.com>
Thu, 24 May 2001 21:39:09 +0000 (21:39 +0000)
gas/ChangeLog
gas/config/obj-coff.c
gas/config/tc-ppc.c

index 01cc01741a6507daa99dd5bfeba7f32857e82898..6ae3422c0670cf66e077eb45a47bcb1571d56646 100644 (file)
@@ -1,3 +1,9 @@
+2000-05-24  Tom Rix <trix@redhat.com>
+
+       * config/obj-coff.c : (add_lineno) xcoff allows negative line
+       numbers
+       * config/tc-ppc.c (ppc_stabx) : fix generated symbol
+       
 2001-05-24  Alan Modra  <amodra@one.net.au>
 
        * write.c (write_object_file): Set finalize_syms = 1 before
index 1961fec5c62b08fb0cd3e1acf02e580b434bf914..da07960b3cc18c4b60f698633c90b7547942fe17 100644 (file)
@@ -446,12 +446,17 @@ add_lineno (frag, offset, num)
     {
       abort ();
     }
+
+#ifndef OBJ_XCOFF
+  /* The native aix assembler accepts negative line number */
+
   if (num <= 0)
     {
       /* Zero is used as an end marker in the file.  */
       as_warn (_("Line numbers must be positive integers\n"));
       num = 1;
     }
+#endif /* OBJ_XCOFF */
   new_line->next = line_nos;
   new_line->frag = frag;
   new_line->l.line_number = num;
index 08606458bde71b64a34c6418568a0d5ecd83189b..73a0db954772ee8d0c3274719027c896a35baf78 100644 (file)
@@ -2845,9 +2845,31 @@ ppc_stabx (ignore)
 
   symbol_get_tc (sym)->output = 1;
 
-  if (S_GET_STORAGE_CLASS (sym) == C_STSYM)
+  if (S_GET_STORAGE_CLASS (sym) == C_STSYM) {
+         
     symbol_get_tc (sym)->within = ppc_current_block;
 
+    /*
+      In this case :
+      
+      .bs name
+      .stabx   "z",arrays_,133,0
+      .es
+      
+      .comm arrays_,13768,3
+      
+      resolve_symbol_value will copy the exp's "within" into sym's when the
+      offset is 0.  Since this seems to be corner case problem,
+      only do the correction for storage class C_STSYM.  A better solution
+      would be to have the tc  field updated in ppc_symbol_new_hook.
+      
+    */
+
+    if (exp.X_op == O_symbol) {
+               symbol_get_tc (exp.X_add_symbol)->within = ppc_current_block;
+    }
+  }
+  
   if (exp.X_op != O_symbol
       || ! S_IS_EXTERNAL (exp.X_add_symbol)
       || S_GET_SEGMENT (exp.X_add_symbol) != bss_section)
This page took 0.034614 seconds and 4 git commands to generate.