This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Indexed string tables?
- From: Ian Lance Taylor <iant at google dot com>
- To: Bernd Jendrissek <bernd dot jendrissek at gmail dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Tue, 07 Dec 2010 16:05:52 -0800
- Subject: Re: Indexed string tables?
- References: <AANLkTin+CbdUm=6R7Qo5WB=5hDWd4wdm4G8M81rbMzpe@mail.gmail.com>
Bernd Jendrissek <bernd.jendrissek@gmail.com> writes:
> I'm updating my support for 16-bit OMF objects, and noticed that
> bfd/hash.c has some sort of string table utilities, but they don't do
> what I need them to do. OMF needs a strings table that is
> sequentially indexed, not hashed a la ELF. I am not and was not aware
> of any such existing utilities, so I wrote a new file, calling it
> strtab.c (and a header). It feels unclean to put such generic
> interfaces into i386omf.c, since there's nothing OMF-specific about
> such a table of strings. Any objections to the name I chose? The
> three functions comprising the interface are all prefixed with strtab_
> - same goes, comments? I'm asking now because I hope to avoid having
> to rewrite history when I submit my OMF total-changes patch,
> preferring to preserve its history as much as is reasonable.
I would say that the string tables in bfd/hash.c are sequentially
indexed. The hash table is there so that duplicate strings are only
entered once. What do you want to do for duplicate strings? Enter them
into the string table more than once?
Ian