{ }
void
- visit(unsigned int got_type, unsigned int got_offset)
+ visit(unsigned int got_type, unsigned int got_offset, uint64_t)
{
unsigned int got_index = got_offset / this->info_.got_entry_size;
gold_assert(got_index < this->info_.got_count);
unsigned char* pov = this->info_.got_desc_p + got_index * 8;
elfcpp::Swap<32, big_endian>::writeval(pov, this->info_.sym_index);
elfcpp::Swap<32, big_endian>::writeval(pov + 4, this->info_.input_index);
+ // FIXME: the uint64_t addend should be written here if powerpc64
+ // sym+addend got entries are to be supported, with similar changes
+ // to Global_got_offset_visitor and support to read them back in
+ // do_process_got_plt.
+ // FIXME: don't we need this for section symbol plus addend anyway?
+ // (See 2015-12-03 commit 7ef8ae7c5f35)
}
private:
{ }
void
- visit(unsigned int got_type, unsigned int got_offset)
+ visit(unsigned int got_type, unsigned int got_offset, uint64_t)
{
unsigned int got_index = got_offset / this->info_.got_entry_size;
gold_assert(got_index < this->info_.got_count);
{
public:
Got_offset_list()
- : got_type_(-1U), got_offset_(0), got_next_(NULL)
+ : got_type_(-1U), got_offset_(0), addend_(0), got_next_(NULL)
{ }
- Got_offset_list(unsigned int got_type, unsigned int got_offset)
- : got_type_(got_type), got_offset_(got_offset), got_next_(NULL)
+ Got_offset_list(unsigned int got_type, unsigned int got_offset,
+ uint64_t addend)
+ : got_type_(got_type), got_offset_(got_offset), addend_(addend),
+ got_next_(NULL)
{ }
~Got_offset_list()
{
this->got_type_ = -1U;
this->got_offset_ = 0;
+ this->addend_ = 0;
this->got_next_ = NULL;
}
// Set the offset for the GOT entry of type GOT_TYPE.
void
- set_offset(unsigned int got_type, unsigned int got_offset)
+ set_offset(unsigned int got_type, unsigned int got_offset, uint64_t addend)
{
if (this->got_type_ == -1U)
{
this->got_type_ = got_type;
this->got_offset_ = got_offset;
+ this->addend_ = addend;
}
else
{
for (Got_offset_list* g = this; g != NULL; g = g->got_next_)
{
- if (g->got_type_ == got_type)
+ if (g->got_type_ == got_type && g->addend_ == addend)
{
g->got_offset_ = got_offset;
return;
}
}
- Got_offset_list* g = new Got_offset_list(got_type, got_offset);
+ Got_offset_list* g = new Got_offset_list(got_type, got_offset, addend);
g->got_next_ = this->got_next_;
this->got_next_ = g;
}
// Return the offset for a GOT entry of type GOT_TYPE.
unsigned int
- get_offset(unsigned int got_type) const
+ get_offset(unsigned int got_type, uint64_t addend) const
{
for (const Got_offset_list* g = this; g != NULL; g = g->got_next_)
{
- if (g->got_type_ == got_type)
+ if (g->got_type_ == got_type && g->addend_ == addend)
return g->got_offset_;
}
return -1U;
{ }
virtual void
- visit(unsigned int, unsigned int) = 0;
+ visit(unsigned int, unsigned int, uint64_t) = 0;
};
// Loop over all GOT offset entries, calling a visitor class V for each.
if (this->got_type_ == -1U)
return;
for (const Got_offset_list* g = this; g != NULL; g = g->got_next_)
- v->visit(g->got_type_, g->got_offset_);
+ v->visit(g->got_type_, g->got_offset_, g->addend_);
}
private:
unsigned int got_type_;
unsigned int got_offset_;
+ uint64_t addend_;
Got_offset_list* got_next_;
};
Local_got_offsets::const_iterator p =
this->local_got_offsets_.find(key);
return (p != this->local_got_offsets_.end()
- && p->second->get_offset(got_type) != -1U);
+ && p->second->get_offset(got_type, addend) != -1U);
}
// Return the GOT offset of type GOT_TYPE of the local symbol
Local_got_offsets::const_iterator p =
this->local_got_offsets_.find(key);
gold_assert(p != this->local_got_offsets_.end());
- unsigned int off = p->second->get_offset(got_type);
+ unsigned int off = p->second->get_offset(got_type, addend);
gold_assert(off != -1U);
return off;
}
Local_got_offsets::const_iterator p =
this->local_got_offsets_.find(key);
if (p != this->local_got_offsets_.end())
- p->second->set_offset(got_type, got_offset);
+ p->second->set_offset(got_type, got_offset, addend);
else
{
- Got_offset_list* g = new Got_offset_list(got_type, got_offset);
+ Got_offset_list* g = new Got_offset_list(got_type, got_offset, addend);
std::pair<Local_got_offsets::iterator, bool> ins =
this->local_got_offsets_.insert(std::make_pair(key, g));
gold_assert(ins.second);
// Return whether this symbol has an entry in the GOT section.
// For a TLS symbol, this GOT entry will hold its tp-relative offset.
bool
- has_got_offset(unsigned int got_type) const
- { return this->got_offsets_.get_offset(got_type) != -1U; }
+ has_got_offset(unsigned int got_type, uint64_t addend = 0) const
+ { return this->got_offsets_.get_offset(got_type, addend) != -1U; }
// Return the offset into the GOT section of this symbol.
unsigned int
- got_offset(unsigned int got_type) const
+ got_offset(unsigned int got_type, uint64_t addend = 0) const
{
- unsigned int got_offset = this->got_offsets_.get_offset(got_type);
+ unsigned int got_offset = this->got_offsets_.get_offset(got_type, addend);
gold_assert(got_offset != -1U);
return got_offset;
}
// Set the GOT offset of this symbol.
void
- set_got_offset(unsigned int got_type, unsigned int got_offset)
- { this->got_offsets_.set_offset(got_type, got_offset); }
+ set_got_offset(unsigned int got_type, unsigned int got_offset,
+ uint64_t addend = 0)
+ { this->got_offsets_.set_offset(got_type, got_offset, addend); }
// Return the GOT offset list.
const Got_offset_list*