diff options
author | Alan Modra <amodra@gmail.com> | 2012-08-11 04:41:28 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-08-11 04:41:28 +0000 |
commit | cf43a2fe99107aae4bfdf9bae8380729fb2c7b64 (patch) | |
tree | 8bc1af6d3b4dca7f1e671eea1fbe8b7bfb7bf236 /gold/output.h | |
parent | bad7670a0e26d425d660376c6ac3ccc867783d32 (diff) | |
download | gdb-cf43a2fe99107aae4bfdf9bae8380729fb2c7b64.zip gdb-cf43a2fe99107aae4bfdf9bae8380729fb2c7b64.tar.gz gdb-cf43a2fe99107aae4bfdf9bae8380729fb2c7b64.tar.bz2 |
* object.h (Sized_relobj_file::find_shdr): New function.
(Sized_relobj_file::find_special_sections): New function.
* object.cc (Sized_relobj_file::find_shdr): New function.
(Sized_relobj_file::find_eh_frame): Use find_shdr.
(Sized_relobj_file::find_special_sections): New function, split out..
(Sized_relobj_file::do_read_symbols): ..from here.
* output.h (Output_data_got::replace_constant): New function.
(Output_data_got::num_entries): New function.
(Output_data_got::last_got_offset,set_got_size): Use num_entries.
(Output_data_got::got_offset): Protected rather than private.
(Output_data_got::replace_got_entry): New function.
* output.cc (Output_data_got::replace_got_entry): New function.
* powerpc.cc (class Powerpc_relobj): New.
(class Powerpc_relocate_functions): Delete all psymval variants or
convert to value,addend type. Delete pcrela, pcrela_unaligned.
Implement _ha functions using corresponding _hi function.
(Powerpc_relobj::find_special_sections): New function.
(Target_powerpc::do_make_elf_object): New function.
(class Output_data_got_powerpc): New.
(class Output_data_glink): New.
(class Powerpc_scan_relocatable_reloc): New.
Many more changes througout file.
Diffstat (limited to 'gold/output.h')
-rw-r--r-- | gold/output.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/gold/output.h b/gold/output.h index 170f0ff..9b0f87f 100644 --- a/gold/output.h +++ b/gold/output.h @@ -2257,6 +2257,13 @@ class Output_data_got : public Output_data_got_base return got_offset; } + // Replace GOT entry I with a new constant. + void + replace_constant(unsigned int i, Valtype constant) + { + this->replace_got_entry(i, Got_entry(constant)); + } + // Reserve a slot in the GOT for a local symbol. void reserve_local(unsigned int i, Relobj* object, unsigned int sym_index, @@ -2281,6 +2288,16 @@ class Output_data_got : public Output_data_got_base do_reserve_slot(unsigned int i) { this->free_list_.remove(i * got_size / 8, (i + 1) * got_size / 8); } + // Return the number of words in the GOT. + unsigned int + num_entries () const + { return this->entries_.size(); } + + // Return the offset into the GOT of GOT entry I. + unsigned int + got_offset(unsigned int i) const + { return i * (got_size / 8); } + private: // This POD class holds a single GOT entry. class Got_entry @@ -2352,20 +2369,19 @@ class Output_data_got : public Output_data_got_base unsigned int add_got_entry_pair(Got_entry got_entry_1, Got_entry got_entry_2); - // Return the offset into the GOT of GOT entry I. - unsigned int - got_offset(unsigned int i) const - { return i * (got_size / 8); } + // Replace GOT entry I with a new value. + void + replace_got_entry(unsigned int i, Got_entry got_entry); // Return the offset into the GOT of the last entry added. unsigned int last_got_offset() const - { return this->got_offset(this->entries_.size() - 1); } + { return this->got_offset(this->num_entries() - 1); } // Set the size of the section. void set_got_size() - { this->set_current_data_size(this->got_offset(this->entries_.size())); } + { this->set_current_data_size(this->got_offset(this->num_entries())); } // The list of GOT entries. Got_entries entries_; |