-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-objcopy] [COFF] Update symbol indices in weak externals
Differential Revision: https://reviews.llvm.org/D57006 llvm-svn: 351800
- Loading branch information
Showing
6 changed files
with
89 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# RUN: yaml2obj %s > %t.in.o | ||
|
||
# RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-PRE | ||
|
||
# RUN: llvm-objcopy -N func %t.in.o %t.out.o | ||
# RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-POST | ||
|
||
# RUN: not llvm-objcopy -N .weak.foobar.file1 %t.in.o %t.err.o 2>&1 | FileCheck %s --check-prefix=ERROR | ||
|
||
# SYMBOLS: SYMBOL TABLE: | ||
# SYMBOLS-PRE-NEXT: func | ||
# SYMBOLS-NEXT: .weak.foobar.file1 | ||
# SYMBOLS-NEXT: foobar | ||
# SYMBOLS-PRE-NEXT: AUX indx 1 | ||
# SYMBOLS-POST-NEXT: AUX indx 0 | ||
# SYMBOLS-EMPTY: | ||
|
||
# ERROR: Symbol 'foobar' is missing its weak target | ||
|
||
--- !COFF | ||
header: | ||
Machine: IMAGE_FILE_MACHINE_AMD64 | ||
Characteristics: [ ] | ||
sections: | ||
- Name: .text | ||
Characteristics: [ ] | ||
symbols: | ||
- Name: func | ||
Value: 0 | ||
SectionNumber: 1 | ||
SimpleType: IMAGE_SYM_TYPE_NULL | ||
ComplexType: IMAGE_SYM_DTYPE_NULL | ||
StorageClass: IMAGE_SYM_CLASS_EXTERNAL | ||
- Name: .weak.foobar.file1 | ||
Value: 1 | ||
SectionNumber: 1 | ||
SimpleType: IMAGE_SYM_TYPE_NULL | ||
ComplexType: IMAGE_SYM_DTYPE_NULL | ||
StorageClass: IMAGE_SYM_CLASS_EXTERNAL | ||
- Name: foobar | ||
Value: 0 | ||
SectionNumber: 0 | ||
SimpleType: IMAGE_SYM_TYPE_NULL | ||
ComplexType: IMAGE_SYM_DTYPE_FUNCTION | ||
StorageClass: IMAGE_SYM_CLASS_WEAK_EXTERNAL | ||
WeakExternal: | ||
TagIndex: 1 | ||
Characteristics: IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY | ||
... |
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
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