public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ppc gas negative line number patch
@ 2001-05-24 13:45 Tom Rix
  2001-05-25 20:32 ` Alexandre Oliva
  2001-05-28  2:30 ` Nick Clifton
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Rix @ 2001-05-24 13:45 UTC (permalink / raw)
  To: binutils

xcoff allow negative line numbers, gas is putting out erroneous
warnings. 

(yes i know this patch contains the last one too)
-- 
Tom Rix 
GCC Engineer
trix@redhat.com
256.704.9201
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/ChangeLog,v
retrieving revision 1.867
diff -c -p -r1.867 ChangeLog
*** ChangeLog	2001/05/24 08:19:32	1.867
--- ChangeLog	2001/05/24 20:38:53
***************
*** 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: config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.45
diff -c -p -r1.45 obj-coff.c
*** obj-coff.c	2001/05/22 10:23:49	1.45
--- obj-coff.c	2001/05/24 20:38:53
*************** add_lineno (frag, offset, num)
*** 446,457 ****
--- 446,462 ----
      {
        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: config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.21
diff -c -p -r1.21 tc-ppc.c
*** tc-ppc.c	2001/05/22 10:23:49	1.21
--- tc-ppc.c	2001/05/24 20:38:53
*************** ppc_stabx (ignore)
*** 2845,2853 ****
  
    symbol_get_tc (sym)->output = 1;
  
!   if (S_GET_STORAGE_CLASS (sym) == C_STSYM)
      symbol_get_tc (sym)->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)
--- 2845,2875 ----
  
    symbol_get_tc (sym)->output = 1;
  
!   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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ppc gas negative line number patch
  2001-05-24 13:45 ppc gas negative line number patch Tom Rix
@ 2001-05-25 20:32 ` Alexandre Oliva
  2001-05-28  2:30 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2001-05-25 20:32 UTC (permalink / raw)
  To: Tom Rix; +Cc: binutils

On May 24, 2001, Tom Rix <trix@redhat.com> wrote:

> xcoff allow negative line numbers, gas is putting out erroneous
> warnings. 

Since the warning is now going to be `#ifdef'ed out, I suppose it can
be turned back into an error, as it was until I put my hands on an AIX
box and found I couldn't bootstrap GCC+binutils because of the error.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ppc gas negative line number patch
  2001-05-24 13:45 ppc gas negative line number patch Tom Rix
  2001-05-25 20:32 ` Alexandre Oliva
@ 2001-05-28  2:30 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2001-05-28  2:30 UTC (permalink / raw)
  To: Tom Rix; +Cc: binutils

Hi Tom,

Thanks for submitting this patch.

> + 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
> + 	

Please submit ChangeLog entries as plain text, not context diffs.

> !   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;
> +     }
> +   }
> +   

The formatting of the comment and the if statements is incorrect.

Please fix the above problem, and then consider the patch approved.

Cheers
        Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-28  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-24 13:45 ppc gas negative line number patch Tom Rix
2001-05-25 20:32 ` Alexandre Oliva
2001-05-28  2:30 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).