Fix internal error from command line with unbalanced --start-lib/--end-lib.
authorBenjamin Peterson <bp@benjamin.pe>
Fri, 1 Dec 2017 20:59:36 +0000 (12:59 -0800)
committerCary Coutant <ccoutant@gmail.com>
Fri, 1 Dec 2017 20:59:36 +0000 (12:59 -0800)
commitbd2e3511f74940beec6a39914480ed6ff88c0a71
tree4fd2c80329f90e8957276529424e4cd5fe634981
parent71739b698d47945463f183619078ff680c277f0f
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.
gold/ChangeLog
gold/gold.cc
gold/options.cc
gold/testsuite/Makefile.am
gold/testsuite/Makefile.in
gold/testsuite/empty_command_line_test.sh [new file with mode: 0755]