aboutsummaryrefslogtreecommitdiff
path: root/gold/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/main.cc')
-rw-r--r--gold/main.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gold/main.cc b/gold/main.cc
index 84b4ae9..d8ef582 100644
--- a/gold/main.cc
+++ b/gold/main.cc
@@ -44,6 +44,7 @@
#include "layout.h"
#include "plugin.h"
#include "gc.h"
+#include "icf.h"
#include "incremental.h"
using namespace gold;
@@ -203,9 +204,12 @@ main(int argc, char** argv)
// The list of input objects.
Input_objects input_objects;
- // The Garbage Collection Object.
+ // The Garbage Collection (GC, --gc-sections) Object.
Garbage_collection gc;
+ // The Identical Code Folding (ICF, --icf) Object.
+ Icf icf;
+
// The symbol table. We're going to guess here how many symbols
// we're going to see based on the number of input files. Even when
// this is off, it means at worst we don't quite optimize hashtable
@@ -216,6 +220,9 @@ main(int argc, char** argv)
if (parameters->options().gc_sections())
symtab.set_gc(&gc);
+ if (parameters->options().icf())
+ symtab.set_icf(&icf);
+
// The layout object.
Layout layout(command_line.number_of_input_files(),
&command_line.script_options());