aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-06-25 19:10:00 +0000
committerNick Clifton <nickc@redhat.com>2002-06-25 19:10:00 +0000
commitdae2dd0d26bfe1dda2c61560794074f2bdd292a9 (patch)
tree50371f1f4375a03ff2f9a230cd8c107860e9b303 /bfd/dwarf2.c
parent72cec14173f4137ae3bc9f4caf110a84e77ce623 (diff)
downloadfsf-binutils-gdb-dae2dd0d26bfe1dda2c61560794074f2bdd292a9.zip
fsf-binutils-gdb-dae2dd0d26bfe1dda2c61560794074f2bdd292a9.tar.gz
fsf-binutils-gdb-dae2dd0d26bfe1dda2c61560794074f2bdd292a9.tar.bz2
Check unit->addr_size to read in the proper number of prologue bytes.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index e3b8e27..008582e 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -981,9 +981,20 @@ decode_line_info (unit, stash)
line_ptr = stash->dwarf_line_buffer + unit->line_offset;
/* Read in the prologue. */
- lh.total_length = read_4_bytes (abfd, line_ptr);
- line_ptr += 4;
- offset_size = 4;
+ if (unit->addr_size == 4)
+ {
+ lh.total_length = read_4_bytes (abfd, line_ptr);
+ line_ptr += 4;
+ offset_size = 4;
+ }
+ else
+ {
+ BFD_ASSERT (unit->addr_size == 8);
+ lh.total_length = read_8_bytes (abfd, line_ptr);
+ line_ptr += 8;
+ offset_size = 8;
+ }
+
if (lh.total_length == 0xffffffff)
{
lh.total_length = read_8_bytes (abfd, line_ptr);