diff options
Diffstat (limited to 'test/MC/ELF')
-rw-r--r-- | test/MC/ELF/cfi-offset.s | 2 | ||||
-rw-r--r-- | test/MC/ELF/cfi-sections.s | 38 | ||||
-rw-r--r-- | test/MC/ELF/relocation-386.s | 8 | ||||
-rw-r--r-- | test/MC/ELF/relocation.s | 7 |
4 files changed, 54 insertions, 1 deletions
diff --git a/test/MC/ELF/cfi-offset.s b/test/MC/ELF/cfi-offset.s index 963a76c..f54dec0 100644 --- a/test/MC/ELF/cfi-offset.s +++ b/test/MC/ELF/cfi-offset.s @@ -3,7 +3,7 @@ f: .cfi_startproc nop - .cfi_offset %ebp, -16 + .cfi_offset %rbp, -16 nop .cfi_endproc diff --git a/test/MC/ELF/cfi-sections.s b/test/MC/ELF/cfi-sections.s new file mode 100644 index 0000000..a73f3a9 --- /dev/null +++ b/test/MC/ELF/cfi-sections.s @@ -0,0 +1,38 @@ +// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_64 %s +// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_32 %s + +.cfi_sections .debug_frame + +f1: + .cfi_startproc + nop + .cfi_endproc + +f2: + .cfi_startproc + nop + .cfi_endproc + +// ELF_64: (('sh_name', 0x00000011) # '.debug_frame' +// ELF_64-NEXT: ('sh_type', 0x00000001) +// ELF_64-NEXT: ('sh_flags', 0x00000000) +// ELF_64-NEXT: ('sh_addr', 0x00000000) +// ELF_64-NEXT: ('sh_offset', 0x00000048) +// ELF_64-NEXT: ('sh_size', 0x00000048) +// ELF_64-NEXT: ('sh_link', 0x00000000) +// ELF_64-NEXT: ('sh_info', 0x00000000) +// ELF_64-NEXT: ('sh_addralign', 0x00000008) +// ELF_64-NEXT: ('sh_entsize', 0x00000000) +// ELF_64-NEXT: ('_section_data', '14000000 ffffffff 01000178 100c0708 90010000 00000000 14000000 00000000 00000000 00000000 01000000 00000000 14000000 00000000 00000000 00000000 01000000 00000000') + +// ELF_32: (('sh_name', 0x00000010) # '.debug_frame' +// ELF_32-NEXT: ('sh_type', 0x00000001) +// ELF_32-NEXT: ('sh_flags', 0x00000000) +// ELF_32-NEXT: ('sh_addr', 0x00000000) +// ELF_32-NEXT: ('sh_offset', 0x00000038) +// ELF_32-NEXT: ('sh_size', 0x00000034) +// ELF_32-NEXT: ('sh_link', 0x00000000) +// ELF_32-NEXT: ('sh_info', 0x00000000) +// ELF_32-NEXT: ('sh_addralign', 0x00000004) +// ELF_32-NEXT: ('sh_entsize', 0x00000000) +// ELF_32-NEXT: ('_section_data', '10000000 ffffffff 0100017c 080c0404 88010000 0c000000 00000000 00000000 01000000 0c000000 00000000 01000000 01000000') diff --git a/test/MC/ELF/relocation-386.s b/test/MC/ELF/relocation-386.s index f7b20b5..25f3450 100644 --- a/test/MC/ELF/relocation-386.s +++ b/test/MC/ELF/relocation-386.s @@ -153,6 +153,13 @@ // CHECK-NEXT: ('r_sym', // CHECK-NEXT: ('r_type', 0x00000001) // CHECK-NEXT: ), +// Relocation 24 (foo@GOTTPOFF(%edx)) is of type R_386_TLS_IE_32 and uses the +// symbol +// CHECK-NEXT: Relocation 0x00000018 +// CHECK-NEXT: (('r_offset', 0x0000008e) +// CHECK-NEXT: ('r_sym', 0x0000000d) +// CHECK-NEXT: ('r_type', 0x00000021) +// CHECK-NEXT: ), // Section 4 is bss // CHECK: # Section 0x00000004 @@ -217,6 +224,7 @@ bar2: movl zed@TPOFF(%eax), %eax movl zed@DTPOFF(%eax), %eax pushl $bar + addl foo@GOTTPOFF(%edx), %eax .section zedsec,"awT",@progbits zed: diff --git a/test/MC/ELF/relocation.s b/test/MC/ELF/relocation.s index 4df09e1..2760232 100644 --- a/test/MC/ELF/relocation.s +++ b/test/MC/ELF/relocation.s @@ -17,6 +17,7 @@ bar: pushq $bar movq foo(%rip), %rdx leaq foo-bar(%r14),%r14 + addq $bar,%rax # R_X86_64_32S // CHECK: # Section 0x00000001 @@ -106,6 +107,12 @@ bar: // CHECK-NEXT: ('r_type', 0x00000002) // CHECK-NEXT: ('r_addend', 0x0000005c) +// CHECK: # Relocation 0x0000000e +// CHECK-NEXT: (('r_offset', 0x00000063) +// CHECK-NEXT: ('r_sym', 0x00000002) +// CHECK-NEXT: ('r_type', 0x0000000b) +// CHECK-NEXT: ('r_addend', 0x00000000) + // CHECK: # Symbol 0x00000002 // CHECK: (('st_name', 0x00000000) # '' // CHECK: ('st_bind', 0x00000000) |