This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 3/3] gold: Handle DW_AT_high_pc as offset from DW_AT_low_pc in gdb-index.cc.
- From: Cary Coutant <ccoutant at google dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: binutils at sourceware dot org, jakub at redhat dot com, Ian Lance Taylor <ian at airs dot com>, Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>, Ian Lance Taylor <iant at google dot com>, Doug Kwan <dougkwan at google dot com>
- Date: Fri, 27 Apr 2012 11:21:08 -0700
- Subject: Re: [PATCH 3/3] gold: Handle DW_AT_high_pc as offset from DW_AT_low_pc in gdb-index.cc.
- References: <1335528921-11582-1-git-send-email-mjw@redhat.com> <1335528921-11582-4-git-send-email-mjw@redhat.com>
> ? off_t low_pc = die->ref_attribute(elfcpp::DW_AT_low_pc, &shndx);
> - ?off_t high_pc = die->ref_attribute(elfcpp::DW_AT_high_pc, &shndx2);
> - ?if ((low_pc != 0 || high_pc != 0) && low_pc != -1 && high_pc != -1)
> + ?off_t high_pc = die->address_attribute(elfcpp::DW_AT_high_pc, &shndx2);
> + ?if (high_pc == -1)
> + ? ?{
> + ? ? ?high_pc = die->uint_attribute(elfcpp::DW_AT_high_pc);
> + ? ? ?high_pc += low_pc;
> + ? ? ?shndx2 = shndx;
> + ? ?}
> + ?if ((low_pc != 0 || high_pc != 0) && low_pc != -1)
> ? ? {
> ? ? ? if (shndx != shndx2)
> ? ? ? ? {
You should change the first call for low_pc to use
die->address_attribute() as well.
The rest looks good to me. (I can't approve, though.)
Thanks!
-cary