aboutsummaryrefslogtreecommitdiff
path: root/gold/incremental.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-09-01 17:32:35 +0000
committerIan Lance Taylor <ian@airs.com>2009-09-01 17:32:35 +0000
commit44453f85d94b039d2c66cdd19a49adc2d35f6cda (patch)
tree64a499d7c20a4e8c8c84f037894aed6344f3fcd9 /gold/incremental.cc
parent404c2abb01aeb1f5434d613036ee101bf256e57a (diff)
downloadgdb-44453f85d94b039d2c66cdd19a49adc2d35f6cda.zip
gdb-44453f85d94b039d2c66cdd19a49adc2d35f6cda.tar.gz
gdb-44453f85d94b039d2c66cdd19a49adc2d35f6cda.tar.bz2
* gold.cc: Include "incremental.h".
(queue_initial_tasks): Call Incremental_checker methods. * incremental.cc: Include "output.h". (Incremental_checker::can_incrementally_link_output_file): New method. * incremental.h (Incremental_checker): New class.
Diffstat (limited to 'gold/incremental.cc')
-rw-r--r--gold/incremental.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gold/incremental.cc b/gold/incremental.cc
index 25caabe..4a3ecb1 100644
--- a/gold/incremental.cc
+++ b/gold/incremental.cc
@@ -25,6 +25,7 @@
#include "output.h"
#include "incremental.h"
#include "archive.h"
+#include "output.h"
using elfcpp::Convert;
@@ -149,6 +150,18 @@ class Incremental_inputs_entry_write
internal::Incremental_inputs_entry_data* p_;
};
+// Analyzes the output file to check if incremental linking is possible and
+// (to be done) what files need to be relinked.
+
+bool
+Incremental_checker::can_incrementally_link_output_file()
+{
+ Output_file output(this->output_name_);
+ if (!output.open_for_modification())
+ return false;
+ return true;
+}
+
// Add the command line to the string table, setting
// command_line_key_. In incremental builds, the command line is
// stored in .gnu_incremental_inputs so that the next linker run can