]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gold/output.h
Allow target to add custom dynamic table entries.
[thirdparty/binutils-gdb.git] / gold / output.h
index 1f4b27df659dcfeaefd45ee515d9154147f88a39..ba0cdaabda953ee71d428b1eefa0aadbe8ef254c 100644 (file)
@@ -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.
     };