2010-10-19 00:38:04 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
|
|
|
|
|
2010-10-19 00:58:03 +08:00
|
|
|
// Test that we produce the correct relocation types and that the relocation
|
|
|
|
// to .Lfoo uses the symbol and not the section.
|
2010-10-19 00:38:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
// CHECK: # Symbol 1
|
|
|
|
// CHECK-NEXT: (('st_name', 5) # '.Lfoo'
|
|
|
|
|
|
|
|
// CHECK: # Relocation 0
|
|
|
|
// CHECK-NEXT: (('r_offset', 2)
|
|
|
|
// CHECK-NEXT: ('r_sym', 1)
|
|
|
|
// CHECK-NEXT: ('r_type', 9)
|
2010-10-19 00:58:03 +08:00
|
|
|
// CHECK-NEXT: ),
|
|
|
|
// CHECK-NEXT: # Relocation 1
|
|
|
|
// CHECK-NEXT: (('r_offset',
|
|
|
|
// CHECK-NEXT: ('r_sym',
|
|
|
|
// CHECK-NEXT: ('r_type', 4)
|
2010-10-19 02:36:12 +08:00
|
|
|
// CHECK-NEXT: ),
|
|
|
|
// CHECK-NEXT: # Relocation 2
|
|
|
|
// CHECK-NEXT: (('r_offset',
|
|
|
|
// CHECK-NEXT: ('r_sym',
|
|
|
|
// CHECK-NEXT: ('r_type', 10)
|
|
|
|
// CHECK-NEXT: ),
|
2010-10-19 00:38:04 +08:00
|
|
|
|
|
|
|
.text
|
|
|
|
bar:
|
|
|
|
leal .Lfoo@GOTOFF(%ebx), %eax
|
2010-10-19 00:58:03 +08:00
|
|
|
|
|
|
|
.global bar2
|
|
|
|
bar2:
|
|
|
|
calll bar2@PLT
|
2010-10-19 02:36:12 +08:00
|
|
|
addl $_GLOBAL_OFFSET_TABLE_, %ebx
|
2010-10-19 00:58:03 +08:00
|
|
|
|
|
|
|
.section .rodata.str1.16,"aMS",@progbits,1
|
2010-10-19 00:38:04 +08:00
|
|
|
.Lfoo:
|
|
|
|
.asciz "bool llvm::llvm_start_multithreaded()"
|