From 21401fc7bf67dbf73f4a3eda4bcfc58fa4211584 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 24 Nov 2020 23:41:31 +1030 Subject: Duplicate output sections in scripts Previously, ld merged duplicate output sections if such existed in scripts, except for those with a constraint of SPECIAL. This makes scripts with duplicate output section statements create duplicate output sections in the linker output file. * ldlang.c (lang_output_section_statement_lookup): Change "create" parameter to a tristate, if 2 then always create a new output section statement. Update all callers, with lang_enter_output_section_statement using "2". (map_input_to_output_sections): Don't ignore SPECIAL constraint here. * ldlang.h (lang_output_section_statement_type): Update prototype. (lang_output_section_find): Update. --- ld/ldlang.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ld/ldlang.h') diff --git a/ld/ldlang.h b/ld/ldlang.h index 6675c57..0f1b607 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -586,7 +586,7 @@ extern asection *section_for_dot statement = statement->next) #define lang_output_section_find(NAME) \ - lang_output_section_statement_lookup (NAME, 0, FALSE) + lang_output_section_statement_lookup (NAME, 0, 0) extern void lang_process (void); @@ -605,7 +605,7 @@ extern void lang_add_keepsyms_file extern lang_output_section_statement_type *lang_output_section_get (const asection *); extern lang_output_section_statement_type *lang_output_section_statement_lookup - (const char *, int, bfd_boolean); + (const char *, int, int); extern lang_output_section_statement_type *next_matching_output_section_statement (lang_output_section_statement_type *, int); extern void ldlang_add_undef -- cgit v1.1