This is the mail archive of the binutils@sourceware.cygnus.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]

Re: Unique section ids



  In message <Pine.LNX.4.21.0007061317050.353-100000@front.linuxcare.com.au>you
 write:
  > I'd like to add another field to the asection structure to uniquely
  > identify input sections.  The reason for this is that the hppa port needs
  > to create long branch stubs to local symbols, and some means is needed to
  > make local symbols globally unique so we can use a hash lookup.  I'm
  > currently using the following:
  >  
  > 	  if (h == NULL)
  > 	    sprintf (stub_name + len - 10, "_%08x",
  > 		     (int) sym_sec & 0xffffffff);
  > 
  > ie.  We just tack on the address of the asection structure.  This works
  > quite well, but it has the drawback that the memory address of the
  > structure is fairly random.  For exactly the same input files, stubs
  > output via bfd_hash_traverse come in a different order for different
  > linker builds.  This makes comparison of output files (and debugging the
  > linker) more difficult.
  > 
  > Has anyone a better idea?  Or can point me to an existing way of uniquely
  > identifying input sections short of enumerating over input bfds?
Sounds like a good idea to me.  I've never been proud of that terrible 
code fragment, just about anything would be cleaner.

jeff


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