OSDN Git Service

Don't include options.h in fileread.h. Remove General_options
authoriant <iant>
Fri, 18 Jan 2008 23:26:48 +0000 (23:26 +0000)
committeriant <iant>
Fri, 18 Jan 2008 23:26:48 +0000 (23:26 +0000)
reference from Output_file class.

gold/compressed_output.cc
gold/dynobj.cc
gold/fileread.cc
gold/fileread.h
gold/layout.cc
gold/output.cc
gold/output.h

index d12bfda..6904077 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include "parameters.h"
+#include "options.h"
 #include "compressed_output.h"
 
 namespace gold
index 90abbe7..78594a9 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "elfcpp.h"
 #include "parameters.h"
+#include "options.h"
+#include "script.h"
 #include "symtab.h"
 #include "dynobj.h"
 
index ac96f5f..668151a 100644 (file)
@@ -581,6 +581,20 @@ Input_file::Input_file(const Task* task, const char* name,
   gold_assert(ok);
 }
 
+// Return the position dependent options in force for this file.
+
+const Position_dependent_options&
+Input_file::options() const
+{
+  return this->input_argument_->options();
+}
+
+// Return the name given by the user.  For -lc this will return "c".
+
+const char*
+Input_file::name() const
+{ return this->input_argument_->name(); }
+
 // Open the file.
 
 // If the filename is not absolute, we assume it is in the current
index 428c2f0..d430876 100644 (file)
 #include <map>
 #include <string>
 
-#include "options.h"
 #include "token.h"
 
 namespace gold
 {
 
+class Position_dependent_options;
+class Input_file_argument;
 class Dirsearch;
 class File_view;
 
@@ -383,8 +384,7 @@ class Input_file
 
   // Return the name given by the user.  For -lc this will return "c".
   const char*
-  name() const
-  { return this->input_argument_->name(); }
+  name() const;
 
   // Return the file name.  For -lc this will return something like
   // "/usr/lib/libc.so".
@@ -401,8 +401,7 @@ class Input_file
 
   // Return the position dependent options.
   const Position_dependent_options&
-  options() const
-  { return this->input_argument_->options(); }
+  options() const;
 
   // Return the file.
   File_read&
index 63fd2b8..9f4c922 100644 (file)
@@ -28,6 +28,7 @@
 #include <utility>
 
 #include "parameters.h"
+#include "options.h"
 #include "output.h"
 #include "symtab.h"
 #include "dynobj.h"
@@ -52,8 +53,7 @@ Layout_task_runner::run(Workqueue* workqueue, const Task* task)
 
   // Now we know the final size of the output file and we know where
   // each piece of information goes.
-  Output_file* of = new Output_file(this->options_,
-                                    this->input_objects_->target());
+  Output_file* of = new Output_file(parameters->output_file_name());
   of->open(file_size);
 
   // Queue up the final set of tasks.
index 4c6959e..1060de6 100644 (file)
@@ -1861,7 +1861,7 @@ Output_section::do_write(Output_file* of)
        p != this->fills_.end();
        ++p)
     {
-      std::string fill_data(of->target()->code_fill(p->length()));
+      std::string fill_data(parameters->target()->code_fill(p->length()));
       of->write(output_section_file_offset + p->section_offset(),
                 fill_data.data(), fill_data.size());
     }
@@ -2372,10 +2372,8 @@ Output_segment::write_section_headers_list(const Layout* layout,
 
 // Output_file methods.
 
-Output_file::Output_file(const General_options& options, Target* target)
-  : options_(options),
-    target_(target),
-    name_(options.output_file_name()),
+Output_file::Output_file(const char* name)
+  : name_(name),
     o_(-1),
     file_size_(0),
     base_(NULL),
index f384c8c..96c0247 100644 (file)
@@ -2297,12 +2297,7 @@ class Output_segment
 class Output_file
 {
  public:
-  Output_file(const General_options& options, Target*);
-
-  // Get a pointer to the target.
-  Target*
-  target() const
-  { return this->target_; }
+  Output_file(const char* name);
 
   // Open the output file.  FILE_SIZE is the final size of the file.
   void
@@ -2372,11 +2367,6 @@ class Output_file
   void
   unmap();
 
-
-  // General options.
-  const General_options& options_;
-  // Target.
-  Target* target_;
   // File name.
   const char* name_;
   // File descriptor.