diff options
author | Benjamin Peterson <bp@benjamin.pe> | 2017-12-01 12:59:36 -0800 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2017-12-01 12:59:36 -0800 |
commit | bd2e3511f74940beec6a39914480ed6ff88c0a71 (patch) | |
tree | 4fd2c80329f90e8957276529424e4cd5fe634981 /gold/testsuite/Makefile.am | |
parent | 71739b698d47945463f183619078ff680c277f0f (diff) | |
download | binutils-gdb-bd2e3511f74940beec6a39914480ed6ff88c0a71.tar.gz |
Fix internal error from command line with unbalanced --start-lib/--end-lib.
The problem is that while the command line isn't trivially empty,
it contains no input files. As gold tries to configure the number
of threads to use based on the number of input files, this causes
the assertion failure above. Fix this problem by making the logic
in gold.cc more robust and also adding a better error message
about --start-lib to options.cc.
gold/
PR gold/22406
* gold.cc (queue_initial_tasks) Check for number of real input files.
* options.cc (Command_line::process) Check for unterminated --start-lib
options.
* testsuite/Makefile.am: Add new test script.
* testsuite/Makefile.in: Regenerate.
* testsuite/check_empty_command_lines.sh: New test script.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r-- | gold/testsuite/Makefile.am | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index d8426db62f6..5f7f66ff4b4 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -157,6 +157,10 @@ endif NATIVE_OR_CROSS_LINKER if NATIVE_LINKER if GCC +# Test empty command line error conditions. +check_SCRIPTS += empty_command_line_test.sh +empty_command_line_test.sh: gcctestdir/ld + # Each of these .o's is a useful, small complete program. They're # particularly useful for making sure ld-new's flags do what they're # supposed to (hence their names), but are used for many tests that |