PR27100, final link failed: bad value

The failure on this PR is due to using the same bfd section for
multiple output sections.  Commit 21401fc7bf67 managed to create
duplicate linker script output section statements, but not the actual
bfd sections.

	PR 27100
	* ldlang.h (lang_output_section_statement_type): Add dup_output.
	* ldlang.c (lang_output_section_statement_lookup): Set dup_output.
	(init_os): Test dup_output rather than constraint.
	* testsuite/ld-scripts/pr27100.d,
	* testsuite/ld-scripts/pr27100.s,
	* testsuite/ld-scripts/pr27100.t: New test.
	* testsuite/ld-scripts/data.exp: Run it.  Don't exclude aout here.
	* testsuite/ld-scripts/data.d: Do so here instead.
	* testsuite/ld-scripts/fill.d: Likewise.
	* testsuite/ld-scripts/fill16.d: Likewise.
This commit is contained in:
Alan Modra
2020-12-24 15:56:23 +10:30
parent 62fa7b3c6a
commit de34d42812
10 changed files with 38 additions and 9 deletions

View File

@ -173,6 +173,9 @@ typedef struct lang_output_section_statement_struct
unsigned int after_end : 1;
/* If this section uses the alignment of its input sections. */
unsigned int align_lma_with_input : 1;
/* If script has duplicate output section statements of the same name
create duplicate output sections. */
unsigned int dup_output : 1;
} lang_output_section_statement_type;
typedef struct