This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
patch for bfd/dwarf2.c, support for 16-bits addresses in DWARF-2
- To: binutils@sourceware.cygnus.com
- Subject: patch for bfd/dwarf2.c, support for 16-bits addresses in DWARF-2
- From: Stephane Carrez <stcarrez@worldnet.fr>
- Date: Sun, 5 Sep 1999 11:12:06 +0200
- Cc: stcarrez@worldnet.fr
Hi!
The binutils can support 16-bits addresses in DWARF-2 easily.
Only bfd/dwarf2.c needs to be updated. The 'readelf' tool already
supports 16-bits addresses in DWARF-2.
I've checked this with the 68HC11 port which has 16-bits addresses
and uses DWARF-2 for debugging info.
Can you integrate this patch?
Thanks,
Stephane
1999-09-05 Stephane Carrez <stcarrez@worldnet.fr>
* dwarf2.c (parse_comp_unit): Accept addr_size == 2.
(read_address): Recognize addr_size == 2 for 16-bits targets.
*** gas-i386/binutils/bfd/dwarf2.c Sun Sep 5 10:53:16 1999
--- cygnus/binutils/bfd/dwarf2.c Fri Aug 6 21:36:40 1999
*************** read_address (unit, buf)
*** 341,355 ****
if (unit->addr_size == 4)
{
retval = bfd_get_32 (unit->abfd, (bfd_byte *) buf);
! }
! else if (unit->addr_size == 8)
! {
retval = bfd_get_64 (unit->abfd, (bfd_byte *) buf);
}
- else
- {
- retval = bfd_get_16 (unit->abfd, (bfd_byte *) buf);
- }
return retval;
}
--- 341,349 ----
if (unit->addr_size == 4)
{
retval = bfd_get_32 (unit->abfd, (bfd_byte *) buf);
! } else {
retval = bfd_get_64 (unit->abfd, (bfd_byte *) buf);
}
return retval;
}
*************** parse_comp_unit (abfd, info_ptr, end_ptr
*** 1283,1291 ****
return 0;
}
! if (addr_size != 4 && addr_size != 8 && addr_size != 2)
{
! (*_bfd_error_handler) ("Dwarf Error: found address size '%u', this reader can only handle address sizes '2', '4' and '8'.", addr_size );
bfd_set_error (bfd_error_bad_value);
return 0;
}
--- 1277,1285 ----
return 0;
}
! if (addr_size != 4 && addr_size != 8)
{
! (*_bfd_error_handler) ("Dwarf Error: found address size '%u', this reader can only handle address sizes '4' and '8'.", addr_size );
bfd_set_error (bfd_error_bad_value);
return 0;
}