diff options
author | Zack Weinberg <zackw@panix.com> | 2005-06-01 04:04:19 +0000 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2005-06-01 04:04:19 +0000 |
commit | a359509ed39f8affc5f3e995b57d7611edfbb59d (patch) | |
tree | cea3b01c4597471699599bfb337a20439ee2071b /ld/ldlang.c | |
parent | 7b8f476a17b961ff3d26cf02c8ea0d1da26ff5e6 (diff) | |
download | fsf-binutils-gdb-a359509ed39f8affc5f3e995b57d7611edfbb59d.zip fsf-binutils-gdb-a359509ed39f8affc5f3e995b57d7611edfbb59d.tar.gz fsf-binutils-gdb-a359509ed39f8affc5f3e995b57d7611edfbb59d.tar.bz2 |
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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 17 |
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) { |