forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recommit r373598 "[yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDR…
…SIG sections." Fix: call `consumeError()` for a case missed. Original commit message: SHT_LLVM_ADDRSIG is described here: https://llvm.org/docs/Extensions.html#sht-llvm-addrsig-section-address-significance-table This patch teaches tools to dump them and to parse the YAML declarations of such sections. Differential revision: https://reviews.llvm.org/D68333 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373606 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
George Rimar
committed
Oct 3, 2019
1 parent
da186b0
commit ffd82b4
Showing
7 changed files
with
470 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
## Check how obj2yaml dumps the SHT_LLVM_ADDRSIG section. | ||
|
||
## Check that when possible obj2yaml tries to produce the "Name" tag when | ||
## dumping entries of the SHT_LLVM_ADDRSIG section. It falls back to producing | ||
## the "Index" tag when it can't match a symbol index with a symbol table entry. | ||
|
||
# RUN: yaml2obj --docnum=1 %s -o %t1 | ||
# RUN: obj2yaml %t1 | FileCheck %s --check-prefix=NAME | ||
|
||
# NAME: - Name: .llvm_addrsig | ||
# NAME-NEXT: Type: SHT_LLVM_ADDRSIG | ||
# NAME-NEXT: Link: .symtab | ||
# NAME-NEXT: Symbols: | ||
# NAME-NEXT: - Name: foo | ||
# NAME-NEXT: - Name: bar | ||
# NAME-NEXT: - Index: 0x00000003 | ||
# NAME-NEXT: - Index: 0xFFFFFFFF | ||
# NAME: - Name: .llvm_addrsig_unlinked | ||
# NAME-NEXT: Type: SHT_LLVM_ADDRSIG | ||
# NAME-NEXT: Symbols: | ||
# NAME-NEXT: - Index: 0x00000001 | ||
# NAME-NEXT: - Index: 0x00000002 | ||
# NAME-NEXT: - Index: 0x00000003 | ||
# NAME-NEXT: - Index: 0xFFFFFFFF | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_DYN | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .llvm_addrsig | ||
Type: SHT_LLVM_ADDRSIG | ||
Symbols: | ||
- Index: 1 | ||
- Index: 2 | ||
- Index: 3 | ||
- Index: 0xFFFFFFFF | ||
- Name: .llvm_addrsig_unlinked | ||
Type: SHT_LLVM_ADDRSIG | ||
Link: 0 | ||
Symbols: | ||
- Index: 1 | ||
- Index: 2 | ||
- Index: 3 | ||
- Index: 0xFFFFFFFF | ||
Symbols: | ||
- Name: foo | ||
Type: STT_FUNC | ||
Binding: STB_GLOBAL | ||
- Name: bar | ||
Type: STT_FUNC | ||
Binding: STB_GLOBAL | ||
|
||
## Check that obj2yaml dumps the SHT_LLVM_ADDRSIG section | ||
## data using the "Content" tag when at least one of the entries is broken, | ||
## e.g. because the entry contains a malformed uleb128 value. | ||
|
||
# RUN: yaml2obj --docnum=2 %s -o %t2 | ||
# RUN: obj2yaml %t2 | FileCheck %s --check-prefix=INVALID-ENTRY | ||
|
||
# INVALID-ENTRY: - Name: .llvm_addrsig | ||
# INVALID-ENTRY-NEXT: Type: SHT_LLVM_ADDRSIG | ||
# INVALID-ENTRY-NEXT: Link: .symtab | ||
# INVALID-ENTRY-NEXT: Content: FFFFFFFFFF | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_DYN | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .llvm_addrsig | ||
Type: SHT_LLVM_ADDRSIG | ||
Content: "FFFFFFFFFF" | ||
|
||
## obj2yaml produces a "Symbols" tag when describing an empty SHT_LLVM_ADDRSIG section. | ||
|
||
# RUN: yaml2obj --docnum=3 %s -o %t3 | ||
# RUN: obj2yaml %t3 | FileCheck %s --check-prefix=EMPTY | ||
|
||
# EMPTY: - Name: .llvm_addrsig | ||
# EMPTY-NEXT: Type: SHT_LLVM_ADDRSIG | ||
# EMPTY-NEXT: Link: .symtab | ||
# EMPTY-NEXT: Symbols: [] | ||
|
||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS64 | ||
Data: ELFDATA2LSB | ||
Type: ET_DYN | ||
Machine: EM_X86_64 | ||
Sections: | ||
- Name: .llvm_addrsig | ||
Type: SHT_LLVM_ADDRSIG | ||
Content: "" |
Oops, something went wrong.