* patch for bfd/dwarf2.c, support for 16-bits addresses in DWARF-2
@ 1999-09-05 4:24 Stephane Carrez
0 siblings, 0 replies; only message in thread
From: Stephane Carrez @ 1999-09-05 4:24 UTC (permalink / raw)
To: binutils; +Cc: stcarrez
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-09-05 4:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-05 4:24 patch for bfd/dwarf2.c, support for 16-bits addresses in DWARF-2 Stephane Carrez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).