diff options
author | Cary Coutant <ccoutant@gmail.com> | 2018-02-02 17:44:27 -0800 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2018-02-02 17:44:27 -0800 |
commit | c83344582375e65643c5efe68b3739e87db482f3 (patch) | |
tree | 0e81d7621b64b165f7fd49643ea7928157308e70 /gold/dwarf_reader.cc | |
parent | d73daf84d6c95c9f7854ed76cc566ea5b240bc97 (diff) | |
download | binutils-gdb-c83344582375e65643c5efe68b3739e87db482f3.tar.gz |
Add support for DWARF-4 line number tables.
Reads the maximum_operations_per_instruction field, added in DWARF-4 to the
line number program header.
gold/
* PR gold/22776
* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog): Add
support for DWARF-4 line number tables.
* dwarf_reader.h (Sized_dwarf_line_info::max_ops_per_insn): New field.
Diffstat (limited to 'gold/dwarf_reader.cc')
-rw-r--r-- | gold/dwarf_reader.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index 63502479ebe..5cdb0b2525b 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -1667,6 +1667,17 @@ Sized_dwarf_line_info<size, big_endian>::read_header_prolog( header_.min_insn_length = *lineptr; lineptr += 1; + if (header_.version < 4) + header_.max_ops_per_insn = 1; + else + { + // DWARF 4 added the maximum_operations_per_instruction field. + header_.max_ops_per_insn = *lineptr; + lineptr += 1; + // TODO: Add support for values other than 1. + gold_assert(header_.max_ops_per_insn == 1); + } + header_.default_is_stmt = *lineptr; lineptr += 1; |