gas use of symbol udata.p

Alan Modra amodra@bigpond.net.au
Wed Nov 8 06:30:00 GMT 2006


As far as I can see, nothing uses bsym->udata.p as a pointer back to
the gas symbol struct.  If this field is left NULL, the testcase in
pr 3469 will trigger an error rather than producing a mangled object
file.

	* symbols.c (symbol_create, symbol_clone): Don't set udata.p.

Index: gas/symbols.c
===================================================================
RCS file: /cvs/src/src/gas/symbols.c,v
retrieving revision 1.77
diff -u -p -r1.77 symbols.c
--- gas/symbols.c	22 Sep 2006 11:35:13 -0000	1.77
+++ gas/symbols.c	8 Nov 2006 05:13:29 -0000
@@ -145,7 +145,6 @@ symbol_create (const char *name, /* It i
   symbolP->bsym = bfd_make_empty_symbol (stdoutput);
   if (symbolP->bsym == NULL)
     as_fatal ("bfd_make_empty_symbol: %s", bfd_errmsg (bfd_get_error ()));
-  symbolP->bsym->udata.p = (PTR) symbolP;
   S_SET_NAME (symbolP, preserved_copy_of_name);
 
   S_SET_SEGMENT (symbolP, segment);
@@ -575,7 +574,6 @@ symbol_clone (symbolS *orgsymP, int repl
   bsymnew->name = bsymorg->name;
   bsymnew->flags =  bsymorg->flags;
   bsymnew->section =  bsymorg->section;
-  bsymnew->udata.p = (PTR) newsymP;
   bfd_copy_private_symbol_data (bfd_asymbol_bfd (bsymorg), bsymorg,
 				bfd_asymbol_bfd (bsymnew), bsymnew);
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list