aboutsummaryrefslogtreecommitdiff
path: root/gold/target.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-09-21 05:31:19 +0000
committerIan Lance Taylor <iant@google.com>2007-09-21 05:31:19 +0000
commitc51e6221b8abc026554349b0e8aa59477753b57b (patch)
tree69da000e6f8a21292026aaa1e7a6b040a5298c45 /gold/target.h
parentec51df9f1064740196d016ed12c2624049d80ba9 (diff)
downloadgdb-c51e6221b8abc026554349b0e8aa59477753b57b.zip
gdb-c51e6221b8abc026554349b0e8aa59477753b57b.tar.gz
gdb-c51e6221b8abc026554349b0e8aa59477753b57b.tar.bz2
Use nops when doing alignment padding between code sections.
Diffstat (limited to 'gold/target.h')
-rw-r--r--gold/target.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gold/target.h b/gold/target.h
index 9181a93..06c7c3d 100644
--- a/gold/target.h
+++ b/gold/target.h
@@ -63,6 +63,11 @@ class Target
has_resolve() const
{ return this->pti_->has_resolve; }
+ // Whether this target has a specific code fill function.
+ bool
+ has_code_fill() const
+ { return this->pti_->has_code_fill; }
+
// Return the default name of the dynamic linker.
const char*
dynamic_linker() const
@@ -89,6 +94,13 @@ class Target
finalize_sections(const General_options* options, Layout* layout)
{ return this->do_finalize_sections(options, layout); }
+ // Return a string to use to fill out a code section. This is
+ // basically one or more NOPS which must fill out the specified
+ // length in bytes.
+ std::string
+ code_fill(off_t length)
+ { return this->do_code_fill(length); }
+
protected:
// This struct holds the constant information for a child class. We
// use a struct to avoid the overhead of virtual function calls for
@@ -105,6 +117,8 @@ class Target
bool has_make_symbol;
// Whether this target has a specific resolve function.
bool has_resolve;
+ // Whether this target has a specific code fill function.
+ bool has_code_fill;
// The default dynamic linker name.
const char* dynamic_linker;
// The default text segment address.
@@ -124,6 +138,12 @@ class Target
do_finalize_sections(const General_options*, Layout*)
{ }
+ // Virtual function which must be implemented by the child class if
+ // needed.
+ virtual std::string
+ do_code_fill(off_t)
+ { gold_unreachable(); }
+
private:
Target(const Target&);
Target& operator=(const Target&);