diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-05-27 15:39:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-05-27 15:39:11 +0000 |
commit | 60e8a534070c8dc181b2fb4971b8199597a168f1 (patch) | |
tree | ce0a44394df85f43789686f637a9a9932332259b /ld/ldlang.c | |
parent | 29371b1febb3b9fca6487a9316e44fc4cf657a45 (diff) | |
download | gdb-60e8a534070c8dc181b2fb4971b8199597a168f1.zip gdb-60e8a534070c8dc181b2fb4971b8199597a168f1.tar.gz gdb-60e8a534070c8dc181b2fb4971b8199597a168f1.tar.bz2 |
* ldlang.c (entry_symbol): Make static.
(lang_add_entry): Add cmdline argument.
* ldlang.h (lang_add_entry): Change prototype.
* ldgram.y (statement_anywhere): Change lang_add_entry call.
* lexsup.c (parse_args): Likewise.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 3ad4ac6..b4a3850 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -143,7 +143,7 @@ lang_output_section_statement_type *abs_output_section; lang_statement_list_type *stat_ptr = &statement_list; lang_statement_list_type file_chain = {0}; -CONST char *entry_symbol = 0; +static const char *entry_symbol = 0; boolean lang_has_input_file = false; boolean had_output_filename = false; boolean lang_float_flag = false; @@ -2621,12 +2621,25 @@ lang_section_start (name, address) ad->address = address; } +/* Set the start symbol to NAME. CMDLINE is nonzero if this is called + because of a -e argument on the command line, or zero if this is + called by ENTRY in a linker script. Command line arguments take + precedence. */ + void -lang_add_entry (name) +lang_add_entry (name, cmdline) CONST char *name; + int cmdline; { - if (entry_symbol == NULL) - entry_symbol = name; + static int from_cmdline; + + if (entry_symbol == NULL + || cmdline + || ! from_cmdline) + { + entry_symbol = name; + from_cmdline = cmdline; + } } void |