aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-01-09 19:57:45 +0000
committerIan Lance Taylor <iant@google.com>2008-01-09 19:57:45 +0000
commite5756efb6d46f569d2e99d19f726b32b84f58bd7 (patch)
tree953c35bf025a640d99bccbd4acbce67dc8b677b5 /gold/layout.cc
parentcda30489fc0f7870150158863780d67f5efedd90 (diff)
downloadgdb-e5756efb6d46f569d2e99d19f726b32b84f58bd7.zip
gdb-e5756efb6d46f569d2e99d19f726b32b84f58bd7.tar.gz
gdb-e5756efb6d46f569d2e99d19f726b32b84f58bd7.tar.bz2
Support assignments and expressions in linker scripts.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index a717ed2..7db2e81 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -1,6 +1,6 @@
// layout.cc -- lay out output file sections for gold
-// 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.
@@ -63,9 +63,9 @@ Layout_task_runner::run(Workqueue* workqueue, const Task* task)
// Layout methods.
-Layout::Layout(const General_options& options)
- : options_(options), entry_(options.entry()), namepool_(), sympool_(),
- dynpool_(), signatures_(),
+Layout::Layout(const General_options& options, Script_options* script_options)
+ : options_(options), script_options_(script_options), namepool_(),
+ sympool_(), dynpool_(), signatures_(),
section_name_map_(), segment_list_(), section_list_(),
unattached_section_list_(), special_output_list_(),
section_headers_(NULL), tls_segment_(NULL), symtab_section_(NULL),
@@ -722,7 +722,7 @@ Layout::finalize(const Input_objects* input_objects, Symbol_table* symtab,
// Lay out the file header.
Output_file_header* file_header;
file_header = new Output_file_header(target, symtab, segment_headers,
- this->entry_);
+ this->script_options_->entry());
load_seg->add_initial_output_data(file_header);
this->special_output_list_.push_back(file_header);
@@ -745,6 +745,10 @@ Layout::finalize(const Input_objects* input_objects, Symbol_table* symtab,
if (!parameters->doing_static_link())
this->assign_local_dynsym_offsets(input_objects);
+ // Process any symbol assignments from a linker script. This must
+ // be called after the symbol table has been finalized.
+ this->script_options_->finalize_symbols(symtab, this);
+
// Create the .shstrtab section.
Output_section* shstrtab_section = this->create_shstrtab();