[PATCH 3/3] gold: Handle DW_AT_high_pc as offset from DW_AT_low_pc in gdb-index.cc.
Cary Coutant
ccoutant@google.com
Fri Apr 27 20:00:00 GMT 2012
> 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
More information about the Binutils
mailing list