File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
lib/ExecutionEngine/JITLink
test/ExecutionEngine/JITLink/ppc64 Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,22 @@ Expected<uint16_t> readTargetMachineArch(StringRef Buffer) {
52
52
}
53
53
}
54
54
55
+ if (Data[ELF::EI_DATA] == ELF::ELFDATA2MSB) {
56
+ if (Data[ELF::EI_CLASS] == ELF::ELFCLASS64) {
57
+ if (auto File = llvm::object::ELF64BEFile::create (Buffer)) {
58
+ return File->getHeader ().e_machine ;
59
+ } else {
60
+ return File.takeError ();
61
+ }
62
+ } else if (Data[ELF::EI_CLASS] == ELF::ELFCLASS32) {
63
+ if (auto File = llvm::object::ELF32BEFile::create (Buffer)) {
64
+ return File->getHeader ().e_machine ;
65
+ } else {
66
+ return File.takeError ();
67
+ }
68
+ }
69
+ }
70
+
55
71
return ELF::EM_NONE;
56
72
}
57
73
Original file line number Diff line number Diff line change 2
2
# RUN: llvm-jitlink -abs external_var=0xffff0000 -abs puts=0xffff6400 -abs \
3
3
# RUN: foo=0xffff8800 -noexec %t
4
4
# RUN: llvm-mc -triple=powerpc64-unknown-linux-gnu -filetype=obj -o %t %s
5
- # RUN: not llvm-jitlink -abs external_var=0xffff0000 -abs puts=0xffff6400 -abs \
5
+ # RUN: llvm-jitlink -abs external_var=0xffff0000 -abs puts=0xffff6400 -abs \
6
6
# RUN: foo=0xffff8800 -noexec %t
7
7
#
8
8
# Check typical relocations involving external function call, external variable
You can’t perform that action at this time.
0 commit comments