This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: debug strings output order is arbitrary
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin Uecker <uecker at eecs dot berkeley dot edu>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 18 Mar 2014 10:04:44 +0100
- Subject: Re: debug strings output order is arbitrary
- Authentication-results: sourceware.org; auth=none
- References: <20140315195827 dot 340527e6 at lemur> <CAFiYyc3CnMq4DY0=KpQseRBHCyQGLA_UQuQWmt7LHNXKVRbonQ at mail dot gmail dot com> <20140317140140 dot 02402a2b at lemur>
On Mon, Mar 17, 2014 at 10:01 PM, Martin Uecker
<uecker@eecs.berkeley.edu> wrote:
> Am Mon, 17 Mar 2014 09:44:53 +0100
> schrieb Richard Biener <richard.guenther@gmail.com>:
>
>> On Sun, Mar 16, 2014 at 3:58 AM, Martin Uecker <uecker@eecs.berkeley.edu> wrote:
>> >
>> > Hi list,
>> >
>> > the strings in the ".debug_str" section are output
>> > in an arbitrary order. Could this be changed?
>> >
>> > The function 'output_indirect_strings' in 'gcc/dwarf2out.c'
>> > uses htab_traverse which then outputs the string in the
>> > order they appear in the hash table. Instead, it would
>> > be nicer to output them based on their labels (which are
>> > assigned based on the order of creation).
>> >
>> > This would minimize differences between builds with
>> > slightly different build environments, e.g. directory.
>>
>> Can you propose a patch? Note that at creation time only
>> the string itself is known, so sorting after the string may
>> be another possibility.
>
> I will propose a patch.
>
> Sorting at the end would be easiest, but one could also keep
> track of the order. Is this performance critical?
Sure it is.
> Also it seems there is other stuff which is output/indexed
> in hash table order, maybe this should be changed to.
Maybe.
Richard.
> Martin
>