82 lines · plain
1# REQUIRES: avr2# RUN: llvm-mc -filetype=obj -triple=avr-unknown-linux -mcpu=atmega328p %s -o %t.o3# RUN: ld.lld %t.o -o %t.exe --image-base=0 -Ttext=04# RUN: llvm-objdump -d %t.exe --mcpu=atmega328 | FileCheck %s --check-prefix=ASM5# RUN: llvm-readelf --file-headers --sections -l --symbols %t.exe \6# RUN: | FileCheck %s --check-prefix=ELF7 8main:9 call foo10foo:11 jmp foo12 rcall foo13 rjmp foo14 15# ASM: <main>:16# ASM-NEXT: 0: 0e 94 02 00 call 0x417# ASM: <foo>:18# ASM-NEXT: 4: 0c 94 02 00 jmp 0x419# ASM-NEXT: 8: fd df rcall .-620# ASM-NEXT: a: fc cf rjmp .-821 22# ELF: ELF Header:23# ELF-NEXT: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 0024# ELF-NEXT: Class: ELF3225# ELF-NEXT: Data: 2's complement, little endian26# ELF-NEXT: Version: 1 (current)27# ELF-NEXT: OS/ABI: UNIX - System V28# ELF-NEXT: ABI Version: 029# ELF-NEXT: Type: EXEC (Executable file)30# ELF-NEXT: Machine: Atmel AVR 8-bit microcontroller31# ELF-NEXT: Version: 0x132# ELF-NEXT: Entry point address: 0x033# ELF-NEXT: Start of program headers: 52 (bytes into file)34# ELF-NEXT: Start of section headers: 4216 (bytes into file)35# ELF-NEXT: Flags: 0x85, EF_AVR_ARCH_AVR5, relaxable36# ELF-NEXT: Size of this header: 52 (bytes)37# ELF-NEXT: Size of program headers: 32 (bytes)38# ELF-NEXT: Number of program headers: 439# ELF-NEXT: Size of section headers: 40 (bytes)40# ELF-NEXT: Number of section headers: 641# ELF-NEXT: Section header string table index: 442# ELF-NEXT: There are 6 section headers, starting at offset 0x1078:43 44# ELF: Section Headers:45# ELF-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al46# ELF-NEXT: [ 0] NULL 00000000 000000 000000 00 0 0 047# ELF-NEXT: [ 1] .text PROGBITS 00000000 001000 00000c 00 AX 0 0 448# ELF-NEXT: [ 2] .comment PROGBITS 00000000 00100c 000008 01 MS 0 0 149# ELF-NEXT: [ 3] .symtab SYMTAB 00000000 001014 000030 10 5 3 450# ELF-NEXT: [ 4] .shstrtab STRTAB 00000000 001044 00002a 00 0 0 151# ELF-NEXT: [ 5] .strtab STRTAB 00000000 00106e 00000a 00 0 0 152# ELF-NEXT: Key to Flags:53# ELF-NEXT: W (write), A (alloc), X (execute), M (merge), S (strings), I (info),54# ELF-NEXT: L (link order), O (extra OS processing required), G (group), T (TLS),55# ELF-NEXT: C (compressed), x (unknown), o (OS specific), E (exclude),56# ELF-NEXT: R (retain), p (processor specific)57 58# ELF: Elf file type is EXEC (Executable file)59# ELF-NEXT: Entry point 0x060# ELF-NEXT: There are 4 program headers, starting at offset 5261 62# ELF: Program Headers:63# ELF-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align64# ELF-NEXT: PHDR 0x000034 0x00000034 0x00000034 0x00080 0x00080 R 0x465# ELF-NEXT: LOAD 0x000000 0x00000000 0x00000000 0x000b4 0x000b4 R 0x100066# ELF-NEXT: LOAD 0x001000 0x00000000 0x00000000 0x0000c 0x0000c R E 0x100067# ELF-NEXT: GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x068 69# ELF: Section to Segment mapping:70# ELF-NEXT: Segment Sections...71# ELF-NEXT: 0072# ELF-NEXT: 0173# ELF-NEXT: 02 .text74# ELF-NEXT: 0375# ELF-NEXT: None .comment .symtab .shstrtab .strtab76 77# ELF: Symbol table '.symtab' contains 3 entries:78# ELF-NEXT: Num: Value Size Type Bind Vis Ndx Name79# ELF-NEXT: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND80# ELF-NEXT: 1: 00000000 0 NOTYPE LOCAL DEFAULT 1 main81# ELF-NEXT: 2: 00000004 0 NOTYPE LOCAL DEFAULT 1 foo82