[PATCH] D32991: [ELF] Initial migration of AVR target
Leslie Zhai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 17 02:43:49 PDT 2017
xiangzhai added a comment.
Dear Dylan,
LLVM AVR backend's `printInstruction` issue:
generated by clang
lldb /data/project/LLVM/llvm/build/bin/llvm-objdump
(lldb) target create "/data/project/LLVM/llvm/build/bin/llvm-objdump"
Current executable set to '/data/project/LLVM/llvm/build/bin/llvm-objdump' (x86_64).
(lldb) r -d clang-BareMinimum
Process 16278 launched: '/data/project/LLVM/llvm/build/bin/llvm-objdump' (x86_64)
clang-BareMinimum: file format ELF32-avr
Disassembly of section .text:
setup:
11000: 08 95 ret
loop:
11002: 08 95 ret
main:
11004: 80 e0 ldi 0, Process 16278 stopped
* thread #1, name = 'llvm-objdump', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
frame #0: 0x00007ffff6ca35d3 libLLVM-5.0svn.so`llvm::MCExpr::print(llvm::raw_ostream&, llvm::MCAsmInfo const*, bool) const + 67
libLLVM-5.0svn.so`llvm::MCExpr::print:
-> 0x7ffff6ca35d3 <+67>: movl (%rbx), %eax
0x7ffff6ca35d5 <+69>: cmpq $0x3, %rax
0x7ffff6ca35d9 <+73>: ja 0x7ffff6ca3ae7 ; <+1367>
0x7ffff6ca35df <+79>: movslq (%rbp,%rax,4), %rax
(lldb) bt
* thread #1, name = 'llvm-objdump', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
* frame #0: 0x00007ffff6ca35d3 libLLVM-5.0svn.so`llvm::MCExpr::print(llvm::raw_ostream&, llvm::MCAsmInfo const*, bool) const + 67
frame #1: 0x00007ffff7912c88 libLLVM-5.0svn.so`llvm::AVRInstPrinter::printInstruction(llvm::MCInst const*, llvm::raw_ostream&) + 872
frame #2: 0x00007ffff7913858 libLLVM-5.0svn.so`llvm::AVRInstPrinter::printInst(llvm::MCInst const*, llvm::raw_ostream&, llvm::StringRef, llvm::MCSubtargetInfo const&) + 520
frame #3: 0x0000000000226c9f llvm-objdump`(anonymous namespace)::PrettyPrinter::printInst(llvm::MCInstPrinter&, llvm::MCInst const*, llvm::ArrayRef<unsigned char>, unsigned long, llvm::raw_ostream&, llvm::StringRef, llvm::MCSubtargetInfo const&, (anonymous namespace)::SourcePrinter*) + 207
frame #4: 0x0000000000234ec0 llvm-objdump`DisassembleObject(llvm::object::ObjectFile const*, bool) + 14288
frame #5: 0x0000000000230e1f llvm-objdump`DumpObject(llvm::object::ObjectFile*, llvm::object::Archive const*) + 687
frame #6: 0x0000000000226a4d llvm-objdump`main + 1309
frame #7: 0x00007ffff3b902f1 libc.so.6`__libc_start_main(main=(llvm-objdump`main), argc=3, argv=0x00007fffffffdaa8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffda98) at libc-start.c:289
frame #8: 0x000000000022102a llvm-objdump`_start + 42
(lldb)
or by avr-gcc
lldb /data/project/LLVM/llvm/build/bin/llvm-objdump
(lldb) target create "/data/project/LLVM/llvm/build/bin/llvm-objdump"
Current executable set to '/data/project/LLVM/llvm/build/bin/llvm-objdump' (x86_64).
(lldb) r -d avr-gcc-BareMinimum
Process 15772 launched: '/data/project/LLVM/llvm/build/bin/llvm-objdump' (x86_64)
avr-gcc-BareMinimum: file format ELF32-avr
Disassembly of section .text:
__vectors:
0: 0c 94 34 00 <unknown>
4: 0c 94 3e 00 <unknown>
8: 0c 94 3e 00 <unknown>
c: 0c 94 3e 00 <unknown>
10: 0c 94 3e 00 <unknown>
14: 0c 94 3e 00 <unknown>
18: 0c 94 3e 00 <unknown>
1c: 0c 94 3e 00 <unknown>
20: 0c 94 3e 00 <unknown>
24: 0c 94 3e 00 <unknown>
28: 0c 94 3e 00 <unknown>
2c: 0c 94 3e 00 <unknown>
30: 0c 94 3e 00 <unknown>
34: 0c 94 3e 00 <unknown>
38: 0c 94 3e 00 <unknown>
3c: 0c 94 3e 00 <unknown>
40: 0c 94 3e 00 <unknown>
44: 0c 94 3e 00 <unknown>
48: 0c 94 3e 00 <unknown>
4c: 0c 94 3e 00 <unknown>
50: 0c 94 3e 00 <unknown>
54: 0c 94 3e 00 <unknown>
58: 0c 94 3e 00 <unknown>
5c: 0c 94 3e 00 <unknown>
60: 0c 94 3e 00 <unknown>
64: 0c 94 3e 00 <unknown>
__trampolines_start:
68: 11 24 eor Process 15772 stopped
* thread #1, name = 'llvm-objdump', stop reason = signal SIGSEGV: invalid address (fault address: 0x6)
frame #0: 0x00007ffff6ca35ed libLLVM-5.0svn.so`llvm::MCExpr::print(llvm::raw_ostream&, llvm::MCAsmInfo const*, bool) const + 93
libLLVM-5.0svn.so`llvm::MCExpr::print:
-> 0x7ffff6ca35ed <+93>: movl (%rdi), %eax
0x7ffff6ca35ef <+95>: decl %eax
0x7ffff6ca35f1 <+97>: cmpl $0x1, %eax
0x7ffff6ca35f4 <+100>: ja 0x7ffff6ca3685 ; <+245>
(lldb) bt
* thread #1, name = 'llvm-objdump', stop reason = signal SIGSEGV: invalid address (fault address: 0x6)
* frame #0: 0x00007ffff6ca35ed libLLVM-5.0svn.so`llvm::MCExpr::print(llvm::raw_ostream&, llvm::MCAsmInfo const*, bool) const + 93
frame #1: 0x00007ffff7912a83 libLLVM-5.0svn.so`llvm::AVRInstPrinter::printInstruction(llvm::MCInst const*, llvm::raw_ostream&) + 355
frame #2: 0x00007ffff7913858 libLLVM-5.0svn.so`llvm::AVRInstPrinter::printInst(llvm::MCInst const*, llvm::raw_ostream&, llvm::StringRef, llvm::MCSubtargetInfo const&) + 520
frame #3: 0x0000000000226c9f llvm-objdump`(anonymous namespace)::PrettyPrinter::printInst(llvm::MCInstPrinter&, llvm::MCInst const*, llvm::ArrayRef<unsigned char>, unsigned long, llvm::raw_ostream&, llvm::StringRef, llvm::MCSubtargetInfo const&, (anonymous namespace)::SourcePrinter*) + 207
frame #4: 0x0000000000234ec0 llvm-objdump`DisassembleObject(llvm::object::ObjectFile const*, bool) + 14288
frame #5: 0x0000000000230e1f llvm-objdump`DumpObject(llvm::object::ObjectFile*, llvm::object::Archive const*) + 687
frame #6: 0x0000000000226a4d llvm-objdump`main + 1309
frame #7: 0x00007ffff3b902f1 libc.so.6`__libc_start_main(main=(llvm-objdump`main), argc=3, argv=0x00007fffffffda98, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffda88) at libc-start.c:289
frame #8: 0x000000000022102a llvm-objdump`_start + 42
(lldb)
Regards,
Leslie Zhai
Repository:
rL LLVM
https://reviews.llvm.org/D32991
More information about the llvm-commits
mailing list