diff options
Diffstat (limited to 'gold/archive.cc')
-rw-r--r-- | gold/archive.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gold/archive.cc b/gold/archive.cc index 6d25980..cc69c40 100644 --- a/gold/archive.cc +++ b/gold/archive.cc @@ -138,11 +138,15 @@ Library_base::should_include_member(Symbol_table* symtab, Layout* layout, return Library_base::SHOULD_INCLUDE_YES; } - if (strcmp(sym_name, parameters->entry()) == 0) + if (!parameters->options().relocatable()) { - *why = "entry symbol "; - *why += sym_name; - return Library_base::SHOULD_INCLUDE_YES; + const char* entry_sym = parameters->entry(); + if (entry_sym != NULL && strcmp(sym_name, entry_sym) == 0) + { + *why = "entry symbol "; + *why += sym_name; + return Library_base::SHOULD_INCLUDE_YES; + } } return Library_base::SHOULD_INCLUDE_UNKNOWN; |