2005-07-08 Paul Koning <pkoning@equallogic.com>

* dwarf2.c (read_address): Check sign_extend_vma to handle targets
	where addresses are sign extended.
This commit is contained in:
Paul Koning 2005-07-08 21:42:33 +00:00
parent efd3631498
commit 0af4cd7c60
2 changed files with 33 additions and 9 deletions

View file

@ -1,3 +1,8 @@
2005-07-08 Paul Koning <pkoning@equallogic.com>
* dwarf2.c (read_address): Check sign_extend_vma to handle targets
where addresses are sign extended.
2005-07-08 Ralf Corsepius <ralf.corsepius@rtems.org>
* config.bfd: Mark i960-*-rtems*, or32-*-rtems* as obsolete.

View file

@ -347,16 +347,35 @@ read_indirect_string (struct comp_unit* unit,
static bfd_uint64_t
read_address (struct comp_unit *unit, bfd_byte *buf)
{
switch (unit->addr_size)
int signed_vma = get_elf_backend_data (unit->abfd)->sign_extend_vma;
if (signed_vma)
{
case 8:
return bfd_get_64 (unit->abfd, buf);
case 4:
return bfd_get_32 (unit->abfd, buf);
case 2:
return bfd_get_16 (unit->abfd, buf);
default:
abort ();
switch (unit->addr_size)
{
case 8:
return bfd_get_signed_64 (unit->abfd, buf);
case 4:
return bfd_get_signed_32 (unit->abfd, buf);
case 2:
return bfd_get_signed_16 (unit->abfd, buf);
default:
abort ();
}
}
else
{
switch (unit->addr_size)
{
case 8:
return bfd_get_64 (unit->abfd, buf);
case 4:
return bfd_get_32 (unit->abfd, buf);
case 2:
return bfd_get_16 (unit->abfd, buf);
default:
abort ();
}
}
}