-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-objcopy] Fix prints wrong path when section output path doesn't…
… exist
- Loading branch information
1 parent
7612dcc
commit cf63b7e
Showing
6 changed files
with
191 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
llvm/test/tools/llvm-objcopy/ELF/dump-section-directory-not-exists.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Show that llvm-objcopy report that section file path is not exists. | ||
|
||
# RUN: yaml2obj %s -o %t | ||
|
||
# RUN: not llvm-objcopy --dump-section .text=not_exists/text-section %t 2>&1 \ | ||
# RUN: | FileCheck %s -DINPUT=%t --check-prefix=NO-SUCH-PATH | ||
# NO-SUCH-PATH: error: 'not_exists/text-section': No such file or directory | ||
|
||
!ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_EXEC | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .text | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] | ||
AddressAlign: 0x0000000000001000 | ||
Content: "DEADBEEF" | ||
- Name: .foo | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_WRITE ] | ||
Content: "CAFE" | ||
- Name: .empty | ||
Type: SHT_PROGBITS | ||
Flags: [ SHF_ALLOC ] | ||
- Name: .bar | ||
Type: SHT_NOBITS | ||
Flags: [ SHF_WRITE ] | ||
ProgramHeaders: | ||
- Type: PT_LOAD | ||
Flags: [ PF_X, PF_R ] | ||
FirstSec: .text | ||
LastSec: .text | ||
|
Oops, something went wrong.