From 6ec6968b1b259948ba42f0a47a3da048377058bc Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 22 May 2019 15:58:57 +0100 Subject: Have the linker report an error if the same script is used twice. PR 24576 * ld/ldfile.c: (ldfile_open_command_file_1): Add new parameter - is_script. If true check that the file has not already been parsed as a linker script. (ldfile_open_script_file): New function. (ldfile_try_open_bfd): Use the new function in place of ldfile_open_command_line. * ldmain.c (main): Likewise. * lexsup.c (parse_args): Use the new function for opening linker scripts with the -T option. * ldfile.h (ldfile_open_script_file): Add prototype. --- ld/lexsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ld/lexsup.c') diff --git a/ld/lexsup.c b/ld/lexsup.c index dacb962..2539356 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1243,7 +1243,7 @@ parse_args (unsigned argc, char **argv) break; case 'T': previous_script_handle = saved_script_handle; - ldfile_open_command_file (optarg); + ldfile_open_script_file (optarg); parser_input = input_script; yyparse (); previous_script_handle = NULL; -- cgit v1.1