summaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-08-28 14:23:33 +0930
committerAlan Modra <amodra@gmail.com>2021-09-18 08:20:11 +0930
commit973b2b402ebf660e2bbbac60e85469164d76ecfc (patch)
tree5c483374372e3cde206bc403bf3095e379567e6c /gold/object.h
parent912697efc15768894c13a9370a2fcaa950f24558 (diff)
downloadbinutils-gdb-973b2b402ebf660e2bbbac60e85469164d76ecfc.tar.gz
[GOLD] Remove addend from Local_got_entry_key
This patch removes the addend from Local_got_entry_key, which is unnecessary now that Got_offset_list has an addend. Note that it might be advantageous to keep the addend in Local_got_entry_key when linking objects containing a large number of section_sym+addend@got relocations. I opted to save some memory by removing the field but left the class there in case we might need to restore {sym,addend} lookup. That's also why this change is split out from the Got_offset_list change. PR 28192 * object.h (Local_got_entry_key): Delete addend_ field. Adjust constructor and methods to suit. * object.cc (Sized_relobj::do_for_all_local_got_entries): Update key.
Diffstat (limited to 'gold/object.h')
-rw-r--r--gold/object.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/gold/object.h b/gold/object.h
index 66e565c1b4c..2dbe4b3e1be 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -327,15 +327,15 @@ class Got_offset_list
class Local_got_entry_key
{
public:
- Local_got_entry_key(unsigned int symndx, uint64_t addend)
- : symndx_(symndx), addend_(addend)
+ Local_got_entry_key(unsigned int symndx)
+ : symndx_(symndx)
{}
// Whether this equals to another Local_got_entry_key.
bool
eq(const Local_got_entry_key& key) const
{
- return (this->symndx_ == key.symndx_ && this->addend_ == key.addend_);
+ return this->symndx_ == key.symndx_;
}
// Compute a hash value for this using 64-bit FNV-1a hash.
@@ -345,7 +345,6 @@ class Local_got_entry_key
uint64_t h = 14695981039346656037ULL; // FNV offset basis.
uint64_t prime = 1099511628211ULL;
h = (h ^ static_cast<uint64_t>(this->symndx_)) * prime;
- h = (h ^ static_cast<uint64_t>(this->addend_)) * prime;
return h;
}
@@ -368,8 +367,6 @@ class Local_got_entry_key
private:
// The local symbol index.
unsigned int symndx_;
- // The addend.
- uint64_t addend_;
};
// Type for mapping section index to uncompressed size and contents.
@@ -2135,7 +2132,7 @@ class Sized_relobj : public Relobj
do_local_has_got_offset(unsigned int symndx, unsigned int got_type,
uint64_t addend) const
{
- Local_got_entry_key key(symndx, addend);
+ Local_got_entry_key key(symndx);
Local_got_offsets::const_iterator p =
this->local_got_offsets_.find(key);
return (p != this->local_got_offsets_.end()
@@ -2148,7 +2145,7 @@ class Sized_relobj : public Relobj
do_local_got_offset(unsigned int symndx, unsigned int got_type,
uint64_t addend) const
{
- Local_got_entry_key key(symndx, addend);
+ Local_got_entry_key key(symndx);
Local_got_offsets::const_iterator p =
this->local_got_offsets_.find(key);
gold_assert(p != this->local_got_offsets_.end());
@@ -2163,7 +2160,7 @@ class Sized_relobj : public Relobj
do_set_local_got_offset(unsigned int symndx, unsigned int got_type,
unsigned int got_offset, uint64_t addend)
{
- Local_got_entry_key key(symndx, addend);
+ Local_got_entry_key key(symndx);
Local_got_offsets::const_iterator p =
this->local_got_offsets_.find(key);
if (p != this->local_got_offsets_.end())