diff options
author | Ian Lance Taylor <ian@airs.com> | 1993-12-10 05:33:49 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1993-12-10 05:33:49 +0000 |
commit | 0f6df2eee03e3366cc14683fc7f786acc9d6fb0b (patch) | |
tree | 0d9fb03becfa80880b3a3b2c1cb6926f8961c622 /binutils/nlmheader.y | |
parent | a1328e79d045693feff41d66bf4ae881a1b27311 (diff) | |
download | gdb-0f6df2eee03e3366cc14683fc7f786acc9d6fb0b.zip gdb-0f6df2eee03e3366cc14683fc7f786acc9d6fb0b.tar.gz gdb-0f6df2eee03e3366cc14683fc7f786acc9d6fb0b.tar.bz2 |
* nlmconv.c (debug, unlink_on_exit): New static variables.
(long_options): Add "debug" and "linker".
(main): Handle -d and -l arguments. Make command line input and
output files optional. Parse the command file before opening the
BFD's, which requires storing more information in local variables.
If INPUT names multiple files, link them together. Use OUTPUT for
the output file name if not named on command line.
(show_usage): Changed for new options.
(link_inputs): New function to automatically invoke linker to
handle multiple INPUT files.
(choose_temp_base_try, choose_temp_base, pexecute): New functions,
mostly copied from gcc/gcc.c.
* nlmconv.h (input_files, output_file): Declare.
* nlmheader.y (input_files, output_file): Define.
(command): Support INPUT with a string_list argument. Support
OUTPUT.
(string_list): Renamed from module_list.
* Makefile.in (nlmconv.o): Define LD_NAME based on
program_transform_name.
Fixes PR 3974.
Diffstat (limited to 'binutils/nlmheader.y')
-rw-r--r-- | binutils/nlmheader.y | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/binutils/nlmheader.y b/binutils/nlmheader.y index 2b78b89..caa8f43 100644 --- a/binutils/nlmheader.y +++ b/binutils/nlmheader.y @@ -55,6 +55,8 @@ boolean debug_info; char *exit_procedure; /* Exported symbols (EXPORT). */ struct string_list *export_symbols; +/* List of files from INPUT. */ +struct string_list *input_files; /* Map file name (MAP, FULLMAP). */ char *map_file; /* Whether a full map has been requested (FULLMAP). */ @@ -67,6 +69,8 @@ struct string_list *import_symbols; char *message_file; /* Autoload module list (MODULE). */ struct string_list *modules; +/* File named by OUTPUT. */ +char *output_file; /* File named by SHARELIB. */ char *sharelib_file; /* Start procedure name (START). */ @@ -126,7 +130,7 @@ static char *xstrdup PARAMS ((const char *)); %token <string> QUOTED_STRING /* Typed non-terminals. */ -%type <list> symbol_list_opt symbol_list module_list +%type <list> symbol_list_opt symbol_list string_list %type <string> symbol %% @@ -252,10 +256,9 @@ command: { import_symbols = string_list_append (import_symbols, $3); } - | INPUT STRING + | INPUT string_list { - nlmheader_warn ("INPUT not supported", -1); - free ($2); + input_files = string_list_append (input_files, $2); } | MAP STRING { @@ -265,7 +268,7 @@ command: { message_file = $2; } - | MODULE module_list + | MODULE string_list { modules = string_list_append (modules, $2); } @@ -279,8 +282,10 @@ command: } | OUTPUT STRING { - nlmheader_warn ("OUTPUT not supported", -1); - free ($2); + if (output_file == NULL) + output_file = $2; + else + nlmheader_warn ("ignoring duplicate OUTPUT statement", -1); } | PSEUDOPREEMPTION { @@ -460,14 +465,14 @@ symbol: } ; -/* A list of modules. */ +/* A list of strings. */ -module_list: +string_list: /* May be empty. */ { $$ = NULL; } - | STRING module_list + | STRING string_list { $$ = string_list_cons ($1, $2); } |