aboutsummaryrefslogtreecommitdiff
path: root/bfd/ieee.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-11-09 19:11:52 +0000
committerIan Lance Taylor <ian@airs.com>1999-11-09 19:11:52 +0000
commita8c5faf7f683b74bcca09a8efd7bff654677fb13 (patch)
treef469e33e9af4bf0255e673ae5f37d7eaca7e4aec /bfd/ieee.c
parentc5c834aac9bc219aff5d32713e12d683f57ce176 (diff)
downloadgdb-a8c5faf7f683b74bcca09a8efd7bff654677fb13.zip
gdb-a8c5faf7f683b74bcca09a8efd7bff654677fb13.tar.gz
gdb-a8c5faf7f683b74bcca09a8efd7bff654677fb13.tar.bz2
* ieee.c (ieee_slurp_debug): Get the length of the debug
information right if there is no data part.
Diffstat (limited to 'bfd/ieee.c')
-rw-r--r--bfd/ieee.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ieee.c b/bfd/ieee.c
index aebc064..989d724 100644
--- a/bfd/ieee.c
+++ b/bfd/ieee.c
@@ -1280,6 +1280,7 @@ ieee_slurp_debug (abfd)
{
ieee_data_type *ieee = IEEE_DATA (abfd);
asection *sec;
+ file_ptr debug_end;
if (ieee->w.r.debug_information_part == 0)
return true;
@@ -1289,7 +1290,13 @@ ieee_slurp_debug (abfd)
return false;
sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS;
sec->filepos = ieee->w.r.debug_information_part;
- sec->_raw_size = ieee->w.r.data_part - ieee->w.r.debug_information_part;
+
+ debug_end = ieee->w.r.data_part;
+ if (debug_end == 0)
+ debug_end = ieee->w.r.trailer_part;
+ if (debug_end == 0)
+ debug_end = ieee->w.r.me_record;
+ sec->_raw_size = debug_end - ieee->w.r.debug_information_part;
return true;
}