mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
* dwarf2.c (scan_unit_for_symbols): Account for DW_AT_high_pc
possibly being relative to DW_AT_low_pc. (parse_comp_unit): Likewise.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2012-04-26 Mark Wielaard <mjw@redhat.com>
|
||||||
|
|
||||||
|
* dwarf2.c (scan_unit_for_symbols): Account for DW_AT_high_pc
|
||||||
|
possibly being relative to DW_AT_low_pc.
|
||||||
|
(parse_comp_unit): Likewise.
|
||||||
|
|
||||||
2012-04-26 Andreas Schwab <schwab@linux-m68k.org>
|
2012-04-26 Andreas Schwab <schwab@linux-m68k.org>
|
||||||
|
|
||||||
* elf32-m68k.c (elf_m68k_check_relocs): Mark non-GOT references
|
* elf32-m68k.c (elf_m68k_check_relocs): Mark non-GOT references
|
||||||
|
@ -2092,6 +2092,7 @@ scan_unit_for_symbols (struct comp_unit *unit)
|
|||||||
struct varinfo *var;
|
struct varinfo *var;
|
||||||
bfd_vma low_pc = 0;
|
bfd_vma low_pc = 0;
|
||||||
bfd_vma high_pc = 0;
|
bfd_vma high_pc = 0;
|
||||||
|
bfd_boolean high_pc_relative = FALSE;
|
||||||
|
|
||||||
abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
|
abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
|
||||||
info_ptr += bytes_read;
|
info_ptr += bytes_read;
|
||||||
@ -2197,6 +2198,7 @@ scan_unit_for_symbols (struct comp_unit *unit)
|
|||||||
|
|
||||||
case DW_AT_high_pc:
|
case DW_AT_high_pc:
|
||||||
high_pc = attr.u.val;
|
high_pc = attr.u.val;
|
||||||
|
high_pc_relative = attr.form != DW_FORM_addr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_AT_ranges:
|
case DW_AT_ranges:
|
||||||
@ -2275,6 +2277,9 @@ scan_unit_for_symbols (struct comp_unit *unit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (high_pc_relative)
|
||||||
|
high_pc += low_pc;
|
||||||
|
|
||||||
if (func && high_pc != 0)
|
if (func && high_pc != 0)
|
||||||
{
|
{
|
||||||
if (!arange_add (unit->abfd, &func->arange, low_pc, high_pc))
|
if (!arange_add (unit->abfd, &func->arange, low_pc, high_pc))
|
||||||
@ -2338,6 +2343,7 @@ parse_comp_unit (struct dwarf2_debug *stash,
|
|||||||
bfd_vma low_pc = 0;
|
bfd_vma low_pc = 0;
|
||||||
bfd_vma high_pc = 0;
|
bfd_vma high_pc = 0;
|
||||||
bfd *abfd = stash->bfd_ptr;
|
bfd *abfd = stash->bfd_ptr;
|
||||||
|
bfd_boolean high_pc_relative = FALSE;
|
||||||
|
|
||||||
version = read_2_bytes (abfd, info_ptr);
|
version = read_2_bytes (abfd, info_ptr);
|
||||||
info_ptr += 2;
|
info_ptr += 2;
|
||||||
@ -2440,6 +2446,7 @@ parse_comp_unit (struct dwarf2_debug *stash,
|
|||||||
|
|
||||||
case DW_AT_high_pc:
|
case DW_AT_high_pc:
|
||||||
high_pc = attr.u.val;
|
high_pc = attr.u.val;
|
||||||
|
high_pc_relative = attr.form != DW_FORM_addr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DW_AT_ranges:
|
case DW_AT_ranges:
|
||||||
@ -2467,6 +2474,8 @@ parse_comp_unit (struct dwarf2_debug *stash,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (high_pc_relative)
|
||||||
|
high_pc += low_pc;
|
||||||
if (high_pc != 0)
|
if (high_pc != 0)
|
||||||
{
|
{
|
||||||
if (!arange_add (unit->abfd, &unit->arange, low_pc, high_pc))
|
if (!arange_add (unit->abfd, &unit->arange, low_pc, high_pc))
|
||||||
|
Reference in New Issue
Block a user