diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-12-01 19:49:22 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-12-01 19:49:22 +0000 |
commit | 4dbfafccf0dd346e7a73cddf85c600aa7afa3644 (patch) | |
tree | 48e04173f24d3f0584279ae2a043809cbe100616 /gold/reloc.cc | |
parent | 148c11bf2e571032ff6b7baa6c364a2b01f0b42e (diff) | |
download | gdb-4dbfafccf0dd346e7a73cddf85c600aa7afa3644.zip gdb-4dbfafccf0dd346e7a73cddf85c600aa7afa3644.tar.gz gdb-4dbfafccf0dd346e7a73cddf85c600aa7afa3644.tar.bz2 |
* dwarf_reader.h (class Sized_dwarf_line_info): Add
track_relocs_type_ field.
* dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
Set track_relocs_type_.
(Sized_dwarf_line_info::process_one_opcode): Ignore the section
contents when using RELA relocs.
(Sized_dwarf_line_info::read_relocs): Add the reloc addend to
reloc_map_.
* reloc.cc (Track_relocs::next_addend): New function.
* reloc.h (class Track_relocs): Declare next_addend.
Diffstat (limited to 'gold/reloc.cc')
-rw-r--r-- | gold/reloc.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/reloc.cc b/gold/reloc.cc index 9ffb693..51ced0f 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -1591,6 +1591,20 @@ Track_relocs<size, big_endian>::next_symndx() const return elfcpp::elf_r_sym<size>(rel.get_r_info()); } +// Return the addend of the next reloc, or 0 if there isn't one. + +template<int size, bool big_endian> +uint64_t +Track_relocs<size, big_endian>::next_addend() const +{ + if (this->pos_ >= this->len_) + return 0; + if (this->reloc_size_ == elfcpp::Elf_sizes<size>::rel_size) + return 0; + elfcpp::Rela<size, big_endian> rela(this->prelocs_ + this->pos_); + return rela.get_r_addend(); +} + // Advance to the next reloc whose r_offset is greater than or equal // to OFFSET. Return the number of relocs we skip. |