diff options
author | Ian Lance Taylor <iant@google.com> | 2007-10-08 07:22:21 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-10-08 07:22:21 +0000 |
commit | e727fa71af6a46ff76ace26a73f8e17bb26559ec (patch) | |
tree | 9a6ff8e24154289d84963f376e3255a8e57a14f2 /gold/output.cc | |
parent | af6359d59d84cdd70fd1f400b91bc2fdcbed7dfa (diff) | |
download | gdb-e727fa71af6a46ff76ace26a73f8e17bb26559ec.zip gdb-e727fa71af6a46ff76ace26a73f8e17bb26559ec.tar.gz gdb-e727fa71af6a46ff76ace26a73f8e17bb26559ec.tar.bz2 |
Add support for local GOT offsets.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gold/output.cc b/gold/output.cc index 34fdc67..f217b03 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -679,7 +679,8 @@ Output_data_got<size, big_endian>::Got_entry::write(unsigned char* pov) const break; default: - gold_unreachable(); + val = this->u_.object->local_symbol_value(this->local_sym_index_); + break; } elfcpp::Swap<size, big_endian>::writeval(pov, val); @@ -704,6 +705,24 @@ Output_data_got<size, big_endian>::add_global(Symbol* gsym) return true; } +// Add an entry for a local symbol to the GOT. This returns true if +// this is a new GOT entry, false if the symbol already has a GOT +// entry. + +template<int size, bool big_endian> +bool +Output_data_got<size, big_endian>::add_local( + Sized_relobj<size, big_endian>* object, + unsigned int symndx) +{ + if (object->local_has_got_offset(symndx)) + return false; + this->entries_.push_back(Got_entry(object, symndx)); + this->set_got_size(); + object->set_local_got_offset(symndx, this->last_got_offset()); + return true; +} + // Write out the GOT. template<int size, bool big_endian> |