diff options
author | Ian Lance Taylor <iant@google.com> | 2006-11-03 18:26:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2006-11-03 18:26:11 +0000 |
commit | ead1e4244a55707685d105c662a9a1faf5d122fe (patch) | |
tree | 3dd8ba9d010b4241ea750f6bdab49c6f3738036a /gold/object.h | |
parent | 58ea3d6a2f4d205b86b1baeaee5f6865393a6dd6 (diff) | |
download | gdb-ead1e4244a55707685d105c662a9a1faf5d122fe.zip gdb-ead1e4244a55707685d105c662a9a1faf5d122fe.tar.gz gdb-ead1e4244a55707685d105c662a9a1faf5d122fe.tar.bz2 |
Can now do a full static link of hello, world in C or C++
Diffstat (limited to 'gold/object.h')
-rw-r--r-- | gold/object.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/gold/object.h b/gold/object.h index 49a1ce9..5e57039 100644 --- a/gold/object.h +++ b/gold/object.h @@ -154,8 +154,8 @@ class Object // Scan the relocs and adjust the symbol table. void scan_relocs(const General_options& options, Symbol_table* symtab, - Read_relocs_data* rd) - { return this->do_scan_relocs(options, symtab, rd); } + Layout* layout, Read_relocs_data* rd) + { return this->do_scan_relocs(options, symtab, layout, rd); } // Initial local symbol processing: set the offset where local // symbol information will be stored; add local symbol names to @@ -184,6 +184,14 @@ class Object inline Output_section* output_section(unsigned int shnum, off_t* poff); + // Set the offset of an input section within its output section. + void + set_section_offset(unsigned int shndx, off_t off) + { + assert(shndx < this->map_to_output_.size()); + this->map_to_output_[shndx].offset = off; + } + // Return the name of a section given a section index. This is only // used for error messages. std::string @@ -218,7 +226,8 @@ class Object // Scan the relocs--implemented by child class. virtual void - do_scan_relocs(const General_options&, Symbol_table*, Read_relocs_data*) = 0; + do_scan_relocs(const General_options&, Symbol_table*, Layout*, + Read_relocs_data*) = 0; // Lay out sections--implemented by child class. virtual void @@ -250,7 +259,8 @@ class Object // Get a view into the underlying file. const unsigned char* - get_view(off_t start, off_t size); + get_view(off_t start, off_t size) + { return this->input_file_->file().get_view(start + this->offset_, size); } // Get the number of sections. unsigned int @@ -269,11 +279,16 @@ class Object // Read data from the underlying file. void - read(off_t start, off_t size, void* p); + read(off_t start, off_t size, void* p) + { this->input_file_->file().read(start + this->offset_, size, p); } // Get a lasting view into the underlying file. File_view* - get_lasting_view(off_t start, off_t size); + get_lasting_view(off_t start, off_t size) + { + return this->input_file_->file().get_lasting_view(start + this->offset_, + size); + } // Return the vector mapping input sections to output sections. std::vector<Map_to_output>& @@ -353,7 +368,8 @@ class Sized_object : public Object // Scan the relocs and adjust the symbol table. void - do_scan_relocs(const General_options&, Symbol_table*, Read_relocs_data*); + do_scan_relocs(const General_options&, Symbol_table*, Layout*, + Read_relocs_data*); // Lay out the input sections. void |