-
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.
[ifs] Allow llvm-ifs to generate text stub from elf stub
ELF stubs generated from llvm-ifs lacks program headers, which prevents llvm-ifs from parsing them properly as program headers are required by llvm's own ELF libraries. This patch adds a few workaround bypass this limitation. Differential Revision: https://reviews.llvm.org/D116769
- Loading branch information
Showing
3 changed files
with
116 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## Test writing stub ELF from IFS and read stub ELF to regenerate IFS. | ||
|
||
# RUN: llvm-ifs --output-elf=%t.elf64l --arch=x86_64 --bitwidth=64 --endianness=little %s | ||
# RUN: llvm-ifs --output-ifs=- --strip-ifs-target %t.elf64l | FileCheck %s | ||
|
||
--- !ifs-v1 | ||
IfsVersion: 3.0 | ||
NeededLibs: | ||
- libc.so.6 | ||
Symbols: | ||
- { Name: bar, Type: Object, Size: 42 } | ||
- { Name: baz, Type: TLS, Size: 3 } | ||
- { Name: plus, Type: Func } | ||
... | ||
|
||
# CHECK: --- !ifs-v1 | ||
# CHECK-NEXT: IfsVersion: 3.0 | ||
# CHECK-NEXT: NeededLibs: | ||
# CHECK-NEXT: - libc.so.6 | ||
# CHECK-NEXT: Symbols: | ||
# CHECK-NEXT: - { Name: bar, Type: Object, Size: 42 } | ||
# CHECK-NEXT: - { Name: baz, Type: TLS, Size: 3 } | ||
# CHECK-NEXT: - { Name: plus, Type: Func } | ||
# CHECK-NEXT: ... |