daily update
[external/binutils.git] / gold / options.h
index 86d9bd7..47623dc 100644 (file)
@@ -1,6 +1,6 @@
 // options.h -- handle command line options for gold  -*- C++ -*-
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -106,7 +106,12 @@ class Search_directory
 class General_options
 {
  public:
-  General_options();
+  General_options(Script_options*);
+
+  // -e: set entry address.
+  const char*
+  entry() const
+  { return this->script_options_->entry(); }
 
   // -E: export dynamic symbols.
   bool
@@ -228,6 +233,11 @@ class General_options
   sysroot() const
   { return this->sysroot_; }
 
+  // --version-script: The version script to apply if --shared is true.
+  const Version_script_info&
+  version_script() const
+  { return *this->script_options_->version_script_info(); }
+
   // -Ttext: The address of the .text section
   uint64_t
   text_segment_address() const
@@ -272,6 +282,15 @@ class General_options
   debug() const
   { return this->debug_; }
 
+  // Return the options which may be set from a linker script.
+  Script_options*
+  script_options()
+  { return this->script_options_; }
+
+  const Script_options*
+  script_options() const
+  { return this->script_options_; }
+
  private:
   // Don't copy this structure.
   General_options(const General_options&);
@@ -312,6 +331,10 @@ class General_options
   };
 
   void
+  set_entry(const char* arg)
+  { this->script_options_->set_entry(arg, strlen(arg)); }
+
+  void
   set_export_dynamic()
   { this->export_dynamic_ = true; }
 
@@ -388,6 +411,9 @@ class General_options
   }
 
   void
+  define_symbol(const char* arg);
+
+  void
   set_demangle()
   { this->demangle_ = true; }
 
@@ -536,6 +562,9 @@ class General_options
   int thread_count_final_;
   Execstack execstack_;
   unsigned int debug_;
+  // Some options can also be set from linker scripts.  Those are
+  // stored here.
+  Script_options* script_options_;
 };
 
 // The current state of the position dependent options.
@@ -800,7 +829,7 @@ class Command_line
  public:
   typedef Input_arguments::const_iterator const_iterator;
 
-  Command_line();
+  Command_line(Script_options*);
 
   // Process the command line options.  This will exit with an
   // appropriate error message if an unrecognized option is seen.
@@ -840,6 +869,15 @@ class Command_line
   position_dependent_options() const
   { return this->position_options_; }
 
+  // Get the options which may be set from a linker script.
+  Script_options*
+  script_options()
+  { return this->options_.script_options(); }
+
+  const Script_options*
+  script_options() const
+  { return this->options_.script_options(); }
+
   // The number of input files.
   int
   number_of_input_files() const