Skip to content

Commit f6e1cce

Browse files
committed
feedback
1 parent 8e22720 commit f6e1cce

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1-
## This test checks general llvm-install-name-tool behavior
1+
## This test checks general llvm-install-name-tool behavior.
22

33
# RUN: yaml2obj %s -o %t
44

5+
## Passing something that doesn't exist
6+
# RUN: not llvm-install-name-tool -add_rpath foo non-existent-binary 2>&1 | FileCheck %s --check-prefix=DOES_NOT_EXIST
7+
8+
# DOES_NOT_EXIST: {{.*}}non-existent-binary
9+
510
## Passing a non-Mach-O binary
6-
# RUN: not llvm-install-name-tool -add_rpath foo %t 2>&1 | FileCheck %s --check-prefix=NON_MACH_O
11+
# RUN: not llvm-install-name-tool -add_rpath foo %t 2>&1 | FileCheck %s --check-prefix=NON_MACH_O -DFILE=%t
712

8-
# NON_MACH_O: llvm-install-name-tool: error: input file: {{.*}} is not a Mach-O file
13+
# NON_MACH_O: llvm-install-name-tool: error: input file: [[FILE]] is not a Mach-O file
914

1015
--- !ELF
1116
FileHeader:
1217
Class: ELFCLASS64
1318
Data: ELFDATA2LSB
1419
Type: ET_EXEC
15-
Machine: EM_X86_64
16-
Sections:
17-
- Name: .bss
18-
Type: SHT_NOBITS
19-
Flags: [ SHF_ALLOC ]
20-
AddressAlign: 0x0000000000000010
21-
Size: 64
22-
- Name: .text
23-
Type: SHT_PROGBITS
24-
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
25-
AddressAlign: 0x0000000000000010
26-
Content: "00000000"

llvm/tools/llvm-objcopy/ObjcopyOptions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
using namespace llvm;
2929
using namespace llvm::objcopy;
30+
using namespace llvm::object;
3031
using namespace llvm::opt;
3132

3233
namespace {
@@ -1243,8 +1244,8 @@ objcopy::parseInstallNameToolOptions(ArrayRef<const char *> ArgsArr) {
12431244
Config.InputFilename = Positional[0];
12441245
Config.OutputFilename = Positional[0];
12451246

1246-
Expected<llvm::object::OwningBinary<llvm::object::Binary>> BinaryOrErr =
1247-
llvm::object::createBinary(Config.InputFilename);
1247+
Expected<OwningBinary<Binary>> BinaryOrErr =
1248+
createBinary(Config.InputFilename);
12481249
if (!BinaryOrErr)
12491250
return createFileError(Config.InputFilename, BinaryOrErr.takeError());
12501251
auto *Binary = (*BinaryOrErr).getBinary();

0 commit comments

Comments
 (0)