brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · ea3d460 Raw
53 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-gnux32 %s -o %t.o3# RUN: llvm-mc -filetype=obj -triple=x86_64-gnux32 %p/Inputs/shared.s -o %t2.o4# RUN: ld.lld -shared -soname=t2 %t2.o -o %t2.so5 6# RUN: ld.lld %t.o %t2.so -o %t7# RUN: llvm-readelf -S -r %t | FileCheck %s8# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=DISASM9 10# CHECK:      Name      Type     Address          Off    Size   ES Flg Lk Inf Al11# CHECK:      .plt      PROGBITS 002011e0 0001e0 000030 00 AX   0   0 1612# CHECK:      .got.plt  PROGBITS 00203278 000278 000028 00 WA   0   0  813# CHECK:      Relocation section '.rela.plt' at offset {{.*}} contains 2 entries:14# CHECK:      00203290 {{.*}} R_X86_64_JUMP_SLOT 00000000 weak + 015# CHECK-NEXT: 00203298 {{.*}} R_X86_64_JUMP_SLOT 00000000 bar + 016 17# DISASM:       <_start>:18# DISASM-NEXT:    callq {{.*}} <local>19# DISASM-NEXT:    callq {{.*}} <bar@plt>20# DISASM-NEXT:    jmp   {{.*}} <bar@plt>21# DISASM-NEXT:    jmp   {{.*}} <weak@plt>22 23# DISASM:      Disassembly of section .plt:24# DISASM-EMPTY:25# DISASM-NEXT: <.plt>:26# DISASM-NEXT: 2011e0:     pushq 8346(%rip)  # 0x20328027# DISASM-NEXT:             jmpq *8348(%rip)  # 0x20328828# DISASM-NEXT:             nopl (%rax)29# DISASM-EMPTY:30# DISASM-NEXT: <weak@plt>:31# DISASM-NEXT: 2011f0:     jmpq *8346(%rip)  # 0x20329032# DISASM-NEXT:             pushq $033# DISASM-NEXT:             jmp 0x2011e0 <.plt>34# DISASM-EMPTY:35# DISASM-NEXT: <bar@plt>:36# DISASM-NEXT: 201200:     jmpq *8338(%rip)  # 0x20329837# DISASM-NEXT:             pushq $138# DISASM-NEXT:             jmp 0x2011e0 <.plt>39# DISASM-NOT:  {{.}}40 41.global _start42.weak weak43 44_start:45  call local46  call bar47  jmp bar@plt48  jmp weak49 50## foo is local and non-preemptale, no PLT is generated.51local:52  ret53