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 3/3] gold: Handle DW_AT_high_pc as offset from DW_AT_low_pc in gdb-index.cc.


> ? 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


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