ELF2: Use 'a.out' as default output file name.

llvm-svn: 248831
This commit is contained in:
Rui Ueyama
2015-09-29 21:49:40 +00:00
parent 4133c18b1c
commit 4eed0114c5
3 changed files with 8 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ namespace lld {
namespace elf2 {
struct Configuration {
llvm::StringRef OutputFile;
llvm::StringRef OutputFile = "a.out";
llvm::StringRef DynamicLinker;
std::string RPath;
std::vector<llvm::StringRef> InputSearchPaths;

View File

@@ -99,13 +99,9 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
// Parse command line options.
opt::InputArgList Args = Parser.parse(ArgsArr);
// Handle -o
if (auto *Arg = Args.getLastArg(OPT_output))
Config->OutputFile = Arg->getValue();
if (Config->OutputFile.empty())
error("-o must be specified.");
// Handle -dynamic-linker
if (auto *Arg = Args.getLastArg(OPT_dynamic_linker))
Config->DynamicLinker = Arg->getValue();

View File

@@ -1,8 +1,14 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: lld -flavor gnu2 %t -o %t2
# RUN: llvm-readobj -file-headers -sections -program-headers -symbols %t2 \
# RUN: | FileCheck %s
# REQUIRES: x86
# RUN: mkdir -p %t.dir
# RUN: (cd %t.dir && lld -flavor gnu2 %t)
# RUN: llvm-readobj -file-headers -sections -program-headers -symbols \
# RUN: %t.dir/a.out | FileCheck %s
# exits with return code 42 on linux
.globl _start;
@@ -181,9 +187,6 @@ _start:
# RUN: llvm-readobj -file-headers -sections -program-headers -symbols %t2 \
# RUN: | FileCheck %s
# RUN: not lld -flavor gnu2 %t 2>&1 | FileCheck --check-prefix=NO_O %s
# NO_O: -o must be specified.
# RUN: not lld -flavor gnu2 %t.foo -o %t2 2>&1 | \
# RUN: FileCheck --check-prefix=MISSING %s
# MISSING: cannot open {{.*}}.foo: {{[Nn]}}o such file or directory