mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Return early if writeMapFile failed.
This patch adds a test for an invalid output path for -Map option, though that test is not for verifying that we are using error() instead of fatal() in writeMapFile. llvm-svn: 292336
This commit is contained in:
@@ -237,7 +237,11 @@ template <class ELFT> void Writer<ELFT>::run() {
|
||||
if (ErrorCount)
|
||||
return;
|
||||
|
||||
// Handle -Map option.
|
||||
writeMapFile<ELFT>(OutputSections);
|
||||
if (ErrorCount)
|
||||
return;
|
||||
|
||||
if (auto EC = Buffer->commit())
|
||||
error("failed to write to the output file: " + EC.message());
|
||||
|
||||
|
||||
@@ -54,3 +54,7 @@ local:
|
||||
// CHECK-NEXT: 0000000000000000 0000000000000039 1 .shstrtab
|
||||
// CHECK-NEXT: 0000000000000000 000000000000002f 1 .strtab
|
||||
// CHECK-NEXT: 0000000000000000 000000000000002f 1 .strtab
|
||||
|
||||
// RUN: not ld.lld %t1.o %t2.o %t3.o %t4.a -o %t -Map=/ 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=FAIL %s
|
||||
// FAIL: cannot open /
|
||||
|
||||
Reference in New Issue
Block a user