public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [committed] gas/config/tc-alpha.c: use symbol accessor
@ 2011-10-21 13:24 Tristan Gingold
  2011-10-24 13:12 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Tristan Gingold @ 2011-10-21 13:24 UTC (permalink / raw)
  To: binutils@sourceware.org Development

Hi,

in the VMS part of tc-alpha.c, there were still a few direct accesses to the symbol structure - which is a very bad idea when the symbol is in fact a local one.  Fixed by this patch.

Tristan.

gas/
2011-10-21  Tristan Gingold  <gingold@adacore.com>

	* config/tc-alpha.c (load_expression): Use symbol_mark_used accessor.
	(s_alpha_comm): Use symbol_set_frag accessor.

Index: config/tc-alpha.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.c,v
retrieving revision 1.99
diff -c -r1.99 tc-alpha.c
*** config/tc-alpha.c	19 Sep 2011 08:24:23 -0000	1.99
--- config/tc-alpha.c	21 Oct 2011 13:20:50 -0000
***************
*** 1394,1400 ****
  		    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_NOP;
  		    ensym = symbol_find_or_make (ensymname);
! 		    ensym->sy_used = 1;
  		    /* The fixup must be the same as the BFD_RELOC_ALPHA_BOH
  		       case in emit_jsrjmp.  See B.4.5.2 of the OpenVMS Linker
  		       Utility Manual.  */
--- 1394,1400 ----
  		    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_NOP;
  		    ensym = symbol_find_or_make (ensymname);
! 		    symbol_mark_used (ensym);
  		    /* The fixup must be the same as the BFD_RELOC_ALPHA_BOH
  		       case in emit_jsrjmp.  See B.4.5.2 of the OpenVMS Linker
  		       Utility Manual.  */
***************
*** 1426,1432 ****
  		    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_LDA;
  		    psym = symbol_find_or_make (psymname);
! 		    psym->sy_used = 1;
  		    insn.fixups[insn.nfixups].exp.X_op = O_subtract;
  		    insn.fixups[insn.nfixups].exp.X_add_symbol = psym;
  		    insn.fixups[insn.nfixups].exp.X_op_symbol = alpha_evax_proc->symbol;
--- 1426,1432 ----
  		    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_LDA;
  		    psym = symbol_find_or_make (psymname);
! 		    symbol_mark_used (psym);
  		    insn.fixups[insn.nfixups].exp.X_op = O_subtract;
  		    insn.fixups[insn.nfixups].exp.X_add_symbol = psym;
  		    insn.fixups[insn.nfixups].exp.X_op_symbol = alpha_evax_proc->symbol;
***************
*** 3602,3608 ****
        frag_align (log_align, 0, 0);
        record_alignment (bss_section, log_align);
  
!       symbolP->sy_frag = frag_now;
        pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
                          size, NULL);
        *pfrag = 0;
--- 3602,3608 ----
        frag_align (log_align, 0, 0);
        record_alignment (bss_section, log_align);
  
!       symbol_set_frag (symbolP, frag_now);
        pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
                          size, NULL);
        *pfrag = 0;

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

* Re: [committed] gas/config/tc-alpha.c: use symbol accessor
  2011-10-21 13:24 [committed] gas/config/tc-alpha.c: use symbol accessor Tristan Gingold
@ 2011-10-24 13:12 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2011-10-24 13:12 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: binutils@sourceware.org Development

Hi Tristan,

> 2011-10-21  Tristan Gingold<gingold@adacore.com>
>
> 	* config/tc-alpha.c (load_expression): Use symbol_mark_used accessor.
> 	(s_alpha_comm): Use symbol_set_frag accessor.

Approved - please apply.

Cheers
   Nick

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

end of thread, other threads:[~2011-10-24 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-21 13:24 [committed] gas/config/tc-alpha.c: use symbol accessor Tristan Gingold
2011-10-24 13:12 ` 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).