forked from Imagelibrary/binutils-gdb
ld:
* ldlang.c (entry_symbol_default): New file-scope global. (lang_finish): Use it, not a hardwired "start". (lang_default_entry): Set it. * ldlang.h: Declare lang_default_entry. * emultempl/beos.em, emultempl/pe.em: Use lang_default_entry, not lang_add_entry, to override default entry point symbol. ld/testsuite: * ld-scripts/align.exp: Mark align1 XFAIL on PECOFF targets. * ld-scripts/data.exp: Mark data UNSUPPORTED on a.out targets. * ld-scripts/provide.exp, ld-scripts/size.exp: Mark all tests UNSUPPORTED on a.out targets. Tidy.
This commit is contained in:
17
ld/ldlang.c
17
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user