This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] Loosen the Gold ODR checker to only compare filenames


Whoops, please don't submit this. The strings that Source_location
points at don't live long enough to use them in the way I'm using
them. I'll send a working patch shortly.

On Wed, Feb 2, 2011 at 10:44 PM, Jeffrey Yasskin <jyasskin@google.com> wrote:
> Code compiled with different flags, especially -O, may have a
> different line number for the first instruction in a function. This
> produces false positives in the ODR checker when linking object files
> that should be ABI-compatible.
>
> The best fixes would be to A) look at the DW_AT_decl_line of the
> DW_TAG_subprogram for the function, but this would require gold to
> parse a whole new debug section, or B) hash the ODR-relevant aspects
> of each function into a new dwarf attribute, but this would require
> gcc to produce the hash and gold to parse a whole new debug section.
>
> Instead, loosening the ODR check to allow a function's definitions to
> be from anywhere within the same file removes the false positives with
> much less work, and would have caused very few extra false negatives
> in Google's codebase.
>
> 2011-02-02 ?Jeffrey Yasskin ?<jyasskin@google.com>
>
> ? ? ? * dwarf_reader.h: Add a Source_location type, and change the
> addr2line functions to return it.
> ? ? ? * dwarf_reader.cc: Implement Source_location, and change the
> addr2line functions to return it.
> ? ? ? * symtab.cc: Sort by just the filename.
> ? ? ? * object.cc: Convert a Source_location return to a std::string.
>


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