summaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gold/object.cc b/gold/object.cc
index f82827c3b2f..1adb851ba1d 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -574,6 +574,17 @@ Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
std::vector<Map_to_output>& map_sections(this->map_to_output());
map_sections.resize(shnum);
+ // If we are only linking for symbols, then there is nothing else to
+ // do here.
+ if (this->input_file()->just_symbols())
+ {
+ delete sd->section_headers;
+ sd->section_headers = NULL;
+ delete sd->section_names;
+ sd->section_names = NULL;
+ return;
+ }
+
// Whether we've seen a .note.GNU-stack section.
bool seen_gnu_stack = false;
// The flags of a .note.GNU-stack section.