From c005eb9e34ac08be0cd40e19a741d345bd43eab9 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 28 Jul 2015 19:20:37 +0100 Subject: ld: Extend options for altering orphan handling behaviour. Replace the options --warn-orphan and --no-warn-orphan with a single option --orphan-handling=MODE, where mode can be place, warn, error, and discard. Mode 'place' is the default, and is the current behaviour, placing the orphan section into a suitable output section. Mode 'warn' is the same as '--warn-orphan'. The orphan is also placed using the same algorithm as for 'place'. Mode 'error' is the same as '--warn-orphan' and '--fatal-warnings'. Mode 'discard' assigns all output sections to the /DISCARD/ section. ld/ChangeLog: * ld.h (enum orphan_handling_enum): New. (ld_config_type): Remove warn_orphan, add orphan_handling. * ldemul.c (ldemul_place_orphan): Remove warning about orphan sections. * ldlang.c (ldlang_place_orphan): New function. (lang_place_orphans): Call ldlang_place_orphan. * ldlex.h (enum option_values): Remove OPTION_WARN_ORPHAN and OPTION_NO_WARN_ORPHAN, add OPTION_ORPHAN_HANDLING. * lexsup.c (ld_options): Remove 'warn-orphan' and 'no-warn-orphan', add 'orphan-handling'. (parse_args): Remove handling for OPTION_WARN_ORPHAN and OPTION_NO_WARN_ORPHAN, add handling for OPTION_ORPHAN_HANDLING. * NEWS: Replace text about --warn-orphan with --orphan-handling. * ld.texinfo (Options): Remove --warn-orphan entry and add entry on --orphan-handling. (Orphan Sections): Add reference to relevant command line options. ld/testsuite/ChangeLog: * ld-elf/elf.exp: Switch to rely on run_dump_test. * ld-elf/orphan-5.l: Update expected output. * ld-elf/orphan-5.d: New file. * ld-elf/orphan-6.d: New file. * ld-elf/orphan-6.l: New file. * ld-elf/orphan-7.d: New file. * ld-elf/orphan-7.map: New file. * ld-elf/orphan-8.d: New file. * ld-elf/orphan-8.map: New file. --- ld/testsuite/ld-elf/orphan-7.map | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ld/testsuite/ld-elf/orphan-7.map (limited to 'ld/testsuite/ld-elf/orphan-7.map') diff --git a/ld/testsuite/ld-elf/orphan-7.map b/ld/testsuite/ld-elf/orphan-7.map new file mode 100644 index 0000000..52cc359 --- /dev/null +++ b/ld/testsuite/ld-elf/orphan-7.map @@ -0,0 +1,7 @@ + +Discarded input sections + + \.notbad 0x0+ 0x4 tmpdir/.*\.o + \.note\.bar 0x0+ 0x4 tmpdir/.*\.o + +#... -- cgit v1.1