// gold.cc -- main linker functions
-// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
}
if (parameters->options().relocatable()
- && (parameters->options().gc_sections() || parameters->options().icf()))
+ && (parameters->options().gc_sections()
+ || parameters->options().icf_enabled()))
gold_error(_("cannot mix -r with --gc-sections or --icf"));
- if (parameters->options().gc_sections() || parameters->options().icf())
+ if (parameters->options().gc_sections()
+ || parameters->options().icf_enabled())
{
workqueue->queue(new Task_function(new Gc_runner(options,
- input_objects,
+ input_objects,
symtab,
layout,
mapfile),
{
// We can read and process the relocations in any order.
blocker->add_blocker();
- workqueue->queue(new Read_relocs(options, symtab, layout, *p,
- symtab_lock, blocker));
+ workqueue->queue(new Read_relocs(symtab, layout, *p, symtab_lock,
+ blocker));
}
Task_token* this_blocker = new Task_token(true);
start_sym = symtab->lookup(parameters->options().entry());
else
start_sym = symtab->lookup("_start");
- if (start_sym !=NULL)
+ if (start_sym != NULL)
{
bool is_ordinary;
unsigned int shndx = start_sym->shndx(&is_ordinary);
// If identical code folding (--icf) is chosen it makes sense to do it
// only after garbage collection (--gc-sections) as we do not want to
// be folding sections that will be garbage.
- if (parameters->options().icf())
+ if (parameters->options().icf_enabled())
{
symtab->icf()->find_identical_sections(input_objects, symtab);
}
// --gc-sections or --icf is turned on, Object::layout is
// called twice. It is called the first time when the
// symbols are added.
- if (parameters->options().gc_sections() || parameters->options().icf())
+ if (parameters->options().gc_sections()
+ || parameters->options().icf_enabled())
{
for (Input_objects::Relobj_iterator p = input_objects->relobj_begin();
p != input_objects->relobj_end();
plugins->layout_deferred_objects();
}
- if (parameters->options().gc_sections() || parameters->options().icf())
+ if (parameters->options().gc_sections()
+ || parameters->options().icf_enabled())
{
for (Input_objects::Relobj_iterator p = input_objects->relobj_begin();
p != input_objects->relobj_end();
workqueue->set_thread_count(thread_count);
// Now we have seen all the input files.
- const bool doing_static_link = (!input_objects->any_dynamic()
- && !parameters->options().shared());
+ const bool doing_static_link =
+ (!input_objects->any_dynamic()
+ && !parameters->options().output_is_position_independent());
set_parameters_doing_static_link(doing_static_link);
if (!doing_static_link && options.is_static())
{
// TODO: if this is too slow, do this as a task, rather than inline.
symtab->detect_odr_violations(task, options.output_file_name());
+ // Do the --no-undefined-version check.
+ if (!parameters->options().undefined_version())
+ {
+ Script_options* so = layout->script_options();
+ so->version_script_info()->check_unmatched_names(symtab);
+ }
+
// Create any automatic note sections.
layout->create_notes();
// If doing garbage collection, the relocations have already been read.
// Otherwise, read and scan the relocations.
- if (parameters->options().gc_sections() || parameters->options().icf())
+ if (parameters->options().gc_sections()
+ || parameters->options().icf_enabled())
{
for (Input_objects::Relobj_iterator p = input_objects->relobj_begin();
p != input_objects->relobj_end();
++p)
{
blocker->add_blocker();
- workqueue->queue(new Scan_relocs(options, symtab, layout, *p,
- (*p)->get_relocs_data(),symtab_lock, blocker));
+ workqueue->queue(new Scan_relocs(symtab, layout, *p,
+ (*p)->get_relocs_data(),
+ symtab_lock, blocker));
}
}
else
// relocations. That task will in turn queue a task to wait
// until it can write to the symbol table.
blocker->add_blocker();
- workqueue->queue(new Read_relocs(options, symtab, layout, *p,
- symtab_lock, blocker));
+ workqueue->queue(new Read_relocs(symtab, layout, *p, symtab_lock,
+ blocker));
}
}
if (input_sections_blocker != NULL)
input_sections_blocker->add_blocker();
final_blocker->add_blocker();
- workqueue->queue(new Relocate_task(options, symtab, layout, *p, of,
+ workqueue->queue(new Relocate_task(symtab, layout, *p, of,
input_sections_blocker,
output_sections_blocker,
final_blocker));