aboutsummaryrefslogtreecommitdiff
path: root/gold/target.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2006-09-29 19:58:17 +0000
committerIan Lance Taylor <iant@google.com>2006-09-29 19:58:17 +0000
commit61ba1cf93601b0a0877a8ade94ba3c674a09f77e (patch)
treeffa744ec1dffd7f2dae13150b1dd7784728ed0a4 /gold/target.h
parent4dba4b2419ccdbf48fd016edb7e0e10016897827 (diff)
downloadgdb-61ba1cf93601b0a0877a8ade94ba3c674a09f77e.zip
gdb-61ba1cf93601b0a0877a8ade94ba3c674a09f77e.tar.gz
gdb-61ba1cf93601b0a0877a8ade94ba3c674a09f77e.tar.bz2
Snapshot. Now able to produce a minimal executable which actually
runs.
Diffstat (limited to 'gold/target.h')
-rw-r--r--gold/target.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/gold/target.h b/gold/target.h
index bba3d5a..5230bb2 100644
--- a/gold/target.h
+++ b/gold/target.h
@@ -15,13 +15,15 @@
#include <cassert>
-#include "symtab.h"
#include "elfcpp.h"
+#include "symtab.h"
namespace gold
{
class Object;
+template<int size, bool big_endian>
+class Sized_object;
// The abstract class for target specific handling.
@@ -42,6 +44,11 @@ class Target
is_big_endian() const
{ return this->pti_->is_big_endian; }
+ // Machine code to store in e_machine field of ELF header.
+ elfcpp::EM
+ machine_code() const
+ { return this->pti_->machine_code; }
+
// Whether this target has a specific make_symbol function.
bool
has_make_symbol() const
@@ -77,6 +84,8 @@ class Target
int size;
// Whether the target is big endian.
bool is_big_endian;
+ // The code to store in the e_machine field of the ELF header.
+ elfcpp::EM machine_code;
// Whether this target has a specific make_symbol function.
bool has_make_symbol;
// Whether this target has a specific resolve function.
@@ -124,6 +133,29 @@ class Sized_target : public Target
resolve(Symbol*, const elfcpp::Sym<size, big_endian>&, Object*)
{ abort(); }
+ // Relocate section data. SYMTAB is the symbol table. OBJECT is
+ // the object in which the section appears. SH_TYPE is the type of
+ // the relocation section, SHT_REL or SHT_RELA. PRELOCS points to
+ // the relocation information. RELOC_COUNT is the number of relocs.
+ // LOCAL_COUNT is the number of local symbols. The VALUES and
+ // GLOBAL_SYMS have symbol table information. VIEW is a view into
+ // the output file holding the section contents, VIEW_ADDRESS is the
+ // virtual address of the view, and VIEW_SIZE is the size of the
+ // view.
+ virtual void
+ relocate_section(const Symbol_table*, // symtab
+ Sized_object<size, big_endian>*, // object
+ unsigned int, // sh_type
+ const unsigned char*, // prelocs
+ size_t, // reloc_count
+ unsigned int, // local_count
+ const typename elfcpp::Elf_types<size>::Elf_Addr*, // values
+ Symbol**, // global_syms
+ unsigned char*, // view
+ typename elfcpp::Elf_types<size>::Elf_Addr, // view_address
+ off_t) // view_size
+ { abort(); }
+
protected:
Sized_target(const Target::Target_info* pti)
: Target(pti)