brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · d385755 Raw
89 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3// RUN: ld.lld --hash-style=sysv -shared %t -o %tout4// RUN: llvm-readobj --sections -r %tout | FileCheck %s5// RUN: llvm-objdump --no-print-imm-hex -d %tout | FileCheck %s --check-prefix=DIS6 7  leaq  a@tlsld(%rip), %rdi8  callq __tls_get_addr@PLT9  leaq  b@tlsld(%rip), %rdi10  callq __tls_get_addr@PLT11  leaq  a@dtpoff(%rax), %rcx12  leaq  b@dtpoff(%rax), %rcx13  .long b@dtpoff, 014  leaq  c@tlsgd(%rip), %rdi15  rex6416  callq __tls_get_addr@PLT17  leaq  a@dtpoff(%rax), %rcx18  // Initial Exec Model Code Sequence, II19  movq c@gottpoff(%rip),%rax20  movq %fs:(%rax),%rax21  movabs $a@dtpoff, %rax22  movabs $b@dtpoff, %rax23  movabs $a@dtpoff, %rax24 25  .global a26  .hidden a27  .section .tbss,"awT",@nobits28  .align 429a:30  .long 031 32  .section .tbss,"awT",@nobits33  .align 434b:35  .long 036  .global c37  .section .tbss,"awT",@nobits38  .align 439c:40  .long 041 42// Get the address of the got, and check that it has 4 entries.43 44// CHECK:      Sections [45// CHECK:          Name: .got (46// CHECK-NEXT:     Type: SHT_PROGBITS47// CHECK-NEXT:     Flags [48// CHECK-NEXT:       SHF_ALLOC49// CHECK-NEXT:       SHF_WRITE50// CHECK-NEXT:     ]51// CHECK-NEXT:     Address: 0x24A052// CHECK-NEXT:     Offset:53// CHECK-NEXT:     Size: 4054 55// CHECK:      Relocations [56// CHECK:        Section ({{.+}}) .rela.dyn {57// CHECK-NEXT:     0x24A0 R_X86_64_DTPMOD64 - 0x058// CHECK-NEXT:     0x24B0 R_X86_64_DTPMOD64 c 0x059// CHECK-NEXT:     0x24B8 R_X86_64_DTPOFF64 c 0x060// CHECK-NEXT:     0x24C0 R_X86_64_TPOFF64 c 0x061// CHECK-NEXT:   }62 63// 4457 = (0x24A0 + -4) - (0x1330 + 3) // PC relative offset to got entry.64// 4445 = (0x24B0 + -4) - (0x133c + 3) // PC relative offset to got entry.65// 4427 = (0x24B8 + -4) - (0x135e + 3) // PC relative offset to got entry.66// 4423 = (0x24C0 + -4) - (0x1372 + 3) // PC relative offset to got entry.67 68// DIS:      Disassembly of section .text:69// DIS-EMPTY:70// DIS-NEXT: <.text>:71// DIS-NEXT:     1330: {{.+}} leaq    4457(%rip), %rdi72// DIS-NEXT:           {{.+}} callq73// DIS-NEXT:     133c: {{.+}} leaq    4445(%rip), %rdi74// DIS-NEXT:           {{.+}} callq75// DIS-NEXT:           {{.+}} leaq    (%rax), %rcx76// DIS-NEXT:           {{.+}} leaq    4(%rax), %rcx77// DIS-NEXT:           04 0078// DIS-NEXT:           00 0079// DIS-NEXT:           00 0080// DIS-NEXT:           00 0081// DIS-NEXT:     135e: {{.+}} leaq    4427(%rip), %rdi82// DIS-NEXT:           {{.+}} callq83// DIS-NEXT:           {{.+}} leaq    (%rax), %rcx84// DIS-NEXT:     1372: {{.+}} movq    4423(%rip), %rax85// DIS-NEXT:           {{.+}} movq    %fs:(%rax), %rax86// DIS-NEXT:           {{.+}} movabsq $0, %rax87// DIS-NEXT:           {{.+}} movabsq $4, %rax88// DIS-NEXT:           {{.+}} movabsq $0, %rax89