aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 835c93a..25374cc 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -91,6 +91,7 @@ lang_statement_list_type lang_output_section_statement;
lang_statement_list_type *stat_ptr = &statement_list;
lang_statement_list_type file_chain = { NULL, NULL };
struct bfd_sym_chain entry_symbol = { NULL, NULL };
+static const char *entry_symbol_default = "start";
const char *entry_section = ".text";
bfd_boolean entry_from_cmdline;
bfd_boolean lang_has_input_file = FALSE;
@@ -4743,9 +4744,9 @@ lang_finish (void)
if (entry_symbol.name == NULL)
{
- /* No entry has been specified. Look for start, but don't warn
- if we don't find it. */
- entry_symbol.name = "start";
+ /* No entry has been specified. Look for the default entry, but
+ don't warn if we don't find it. */
+ entry_symbol.name = entry_symbol_default;
warn = FALSE;
}
@@ -5582,6 +5583,16 @@ lang_add_entry (const char *name, bfd_boolean cmdline)
}
}
+/* Set the default start symbol to NAME. .em files should use this,
+ not lang_add_entry, to override the use of "start" if neither the
+ linker script nor the command line specifies an entry point. NAME
+ must be permanently allocated. */
+void
+lang_default_entry (const char *name)
+{
+ entry_symbol_default = name;
+}
+
void
lang_add_target (const char *name)
{