From Craig Silverstein: implement -Ttext.
[deliverable/binutils-gdb.git] / gold / options.h
index 9848639dff52fd7d88d3ae99f9b49c9a453f4057..d32dd4a5354e932a948ac367891e6f07028c08c9 100644 (file)
@@ -169,7 +169,7 @@ class General_options
   is_static() const
   { return this->is_static_; }
 
-  // --statis: Print resource usage statistics.
+  // --stats: Print resource usage statistics.
   bool
   print_stats() const
   { return this->print_stats_; }
@@ -179,6 +179,16 @@ class General_options
   sysroot() const
   { return this->sysroot_; }
 
+  // -Ttext: The address of the .text section
+  uint64_t
+  text_segment_address() const
+  { return this->text_segment_address_; }
+
+  // Whether -Ttext was used.
+  bool
+  user_set_text_segment_address() const
+  { return this->text_segment_address_ != -1U; }
+
  private:
   // Don't copy this structure.
   General_options(const General_options&);
@@ -264,6 +274,20 @@ class General_options
   set_sysroot(const char* arg)
   { this->sysroot_ = arg; }
 
+  void
+  set_text_segment_address(const char* arg)
+  {
+    char* endptr;
+    this->text_segment_address_ = strtoull(arg, &endptr, 0);
+    if (*endptr != '\0'
+       || this->text_segment_address_ == -1U)
+      {
+        fprintf(stderr, _("%s: invalid argument to -Ttext: %s\n"),
+                program_name, arg);
+        ::exit(1);
+      }
+  }
+
   void
   ignore(const char*)
   { }
@@ -286,6 +310,7 @@ class General_options
   bool is_static_;
   bool print_stats_;
   std::string sysroot_;
+  uint64_t text_segment_address_;
 };
 
 // The current state of the position dependent options.
This page took 0.024057 seconds and 4 git commands to generate.