From 3ea6077552ad86ebb441bef6e1bd40e18d06ab44 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 7 Apr 2015 16:29:41 +0100 Subject: Add new linker option: --warn-orphan which generates warning messages when orphan sections are detected. ld * ld.h (struct ld_config_type): Add new field: warn_orphan. * ldlex.h (enum option_values): Add OPTION_WARN_ORPHAN and OPTION_NO_WARN_ORPHAN. * lexsup.c (ld_options): Add --warn-orphan and --no-warn-orphan. (parse_args): Handle the new options. * ldemul.c (ldemul_place_orphan): If requested, generate a warning message when an orphan section is placed in the output file. * ld.texinfo: Document the new option. * NEWS: Mention the new feature. tests * ld-elf/orphan-5.l: New test - checks the linker's output with --warn-orphan enabled. * ld-elf/elf.exp: Run the new test. --- ld/ld.texinfo | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ld/ld.texinfo') diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 440fa41..82735e9 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -2064,6 +2064,17 @@ option causes a warning to be issued whenever this case occurs. Only warn once for each undefined symbol, rather than once per module which refers to it. +@kindex --warn-orphan +@kindex --no-warn-orphan +@cindex warnings, on orphan sections +@cindex orphan sections, warnings on +@item --warn-orphan +The @option{--warn-orphan} option tells the linker to generate a +warning message whenever it has to place an orphan section into the +output file. @xref{Orphan Sections} The @option{--no-warn-orphan} +option restores the default behaviour of just silently placing these +sections. + @kindex --warn-section-align @cindex warnings, on section alignment @cindex section alignment, warnings on -- cgit v1.1