This is the mail archive of the
mailing list for the binutils project.
Re: Unique section ids
- To: Alan Modra <alan at linuxcare dot com dot au>
- Subject: Re: Unique section ids
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 06 Jul 2000 11:10:02 -0600
- cc: binutils at sourceware dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <Pine.LNX.firstname.lastname@example.org>you
> 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.