aboutsummaryrefslogtreecommitdiff
path: root/gold/output.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2014-03-10 13:34:53 -0700
committerCary Coutant <ccoutant@google.com>2014-03-10 13:34:53 -0700
commit918fc1f8d23c634227c871b67ccb4ed32d0df83c (patch)
treea3904ecadd4c4da6a0b94509be387d622fbda540 /gold/output.h
parent98ff9231545f9ba7221ad64ec1ff17cf52cafc07 (diff)
downloadfsf-binutils-gdb-918fc1f8d23c634227c871b67ccb4ed32d0df83c.zip
fsf-binutils-gdb-918fc1f8d23c634227c871b67ccb4ed32d0df83c.tar.gz
fsf-binutils-gdb-918fc1f8d23c634227c871b67ccb4ed32d0df83c.tar.bz2
Allow target to add custom dynamic table entries.
2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com> gold/ * output.cc (Output_data_dynamic::Dynamic_entry::write): Get the value of DYNAMIC_CUSTOM dynamic entry. * output.h (Output_data_dynamic::add_custom): New function. (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM dynamic entry. (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM. * target.h (Target::dynamic_tag_custom_value): New function. (Target::do_dynamic_tag_custom_value): New function.
Diffstat (limited to 'gold/output.h')
-rw-r--r--gold/output.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/gold/output.h b/gold/output.h
index 1f4b27d..ba0cdaa 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -2577,6 +2577,11 @@ class Output_data_dynamic : public Output_section_data
add_string(elfcpp::DT tag, const std::string& str)
{ this->add_string(tag, str.c_str()); }
+ // Add a new dynamic entry with custom value.
+ void
+ add_custom(elfcpp::DT tag)
+ { this->add_entry(Dynamic_entry(tag)); }
+
protected:
// Adjust the output section to set the entry size.
void
@@ -2641,6 +2646,11 @@ class Output_data_dynamic : public Output_section_data
: tag_(tag), offset_(DYNAMIC_STRING)
{ this->u_.str = str; }
+ // Create an entry with a custom value.
+ Dynamic_entry(elfcpp::DT tag)
+ : tag_(tag), offset_(DYNAMIC_CUSTOM)
+ { }
+
// Return the tag of this entry.
elfcpp::DT
tag() const
@@ -2664,7 +2674,9 @@ class Output_data_dynamic : public Output_section_data
// Symbol adress.
DYNAMIC_SYMBOL = -3U,
// String.
- DYNAMIC_STRING = -4U
+ DYNAMIC_STRING = -4U,
+ // Custom value.
+ DYNAMIC_CUSTOM = -5U
// Any other value indicates a section address plus OFFSET.
};