brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · f36ba69 Raw
81 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o3# RUN: llvm-mc -filetype=obj -triple=x86_64 %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: ld.lld -shared %t.o %t2.so -o %t.so8# RUN: llvm-readelf -S -r %t | FileCheck %s --check-prefix=CHECK19# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s --check-prefixes=DISASM,DISASM110# RUN: llvm-readelf -S -r %t.so | FileCheck %s --check-prefix=CHECK211# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s --check-prefixes=DISASM,DISASM212 13# CHECK1:      Name      Type     Address          Off    Size   ES Flg Lk Inf Al14# CHECK1:      .plt      PROGBITS 00000000002012e0 0002e0 000030 00 AX   0   0 1615# CHECK1:      .got.plt  PROGBITS 00000000002033e0 0003e0 000028 00 WA   0   0  816# CHECK1:      Relocation section '.rela.plt' at offset {{.*}} contains 2 entries:17# CHECK1:      00000000002033f8 {{.*}} R_X86_64_JUMP_SLOT 0000000000000000 weak + 018# CHECK1-NEXT: 0000000000203400 {{.*}} R_X86_64_JUMP_SLOT 0000000000000000 bar + 019 20# CHECK2:      Name      Type     Address          Off    Size   ES Flg Lk Inf Al21# CHECK2:      .plt      PROGBITS 0000000000001310 000310 000030 00 AX   0   0 1622# CHECK2:      .got.plt  PROGBITS 0000000000003400 000400 000028 00 WA   0   0  823# CHECK2:      Relocation section '.rela.plt' at offset {{.*}} contains 2 entries:24# CHECK2:      0000000000003418 {{.*}} R_X86_64_JUMP_SLOT 0000000000000000 weak + 025# CHECK2-NEXT: 0000000000003420 {{.*}} R_X86_64_JUMP_SLOT 0000000000000000 bar + 026 27# DISASM:       <_start>:28# DISASM-NEXT:    callq {{.*}} <local>29# DISASM-NEXT:    callq {{.*}} <bar@plt>30# DISASM-NEXT:    jmp   {{.*}} <bar@plt>31# DISASM-NEXT:    jmp   {{.*}} <weak@plt>32 33# DISASM1:      Disassembly of section .plt:34# DISASM1-EMPTY:35# DISASM1-NEXT: <.plt>:36# DISASM1-NEXT: 2012e0:     pushq 8450(%rip)  # 0x2033e837# DISASM1-NEXT:             jmpq *8452(%rip)  # 0x2033f038# DISASM1-NEXT:             nopl (%rax)39# DISASM1-EMPTY:40# DISASM1-NEXT: <weak@plt>:41# DISASM1-NEXT: 2012f0:     jmpq *8450(%rip)  # 0x2033f842# DISASM1-NEXT:             pushq $043# DISASM1-NEXT:             jmp 0x2012e0 <.plt>44# DISASM1-EMPTY:45# DISASM1-NEXT: <bar@plt>:46# DISASM1-NEXT: 201300:     jmpq *8442(%rip)  # 0x20340047# DISASM1-NEXT:             pushq $148# DISASM1-NEXT:             jmp 0x2012e0 <.plt>49# DISASM1-NOT:  {{.}}50 51# DISASM2:      Disassembly of section .plt:52# DISASM2-EMPTY:53# DISASM2-NEXT: <.plt>:54# DISASM2-NEXT:   1310:     pushq 8434(%rip)  # 0x340855# DISASM2-NEXT:             jmpq *8436(%rip)  # 0x341056# DISASM2-NEXT:             nopl (%rax)57# DISASM2-EMPTY:58# DISASM2-NEXT: <weak@plt>:59# DISASM2-NEXT:   1320:     jmpq *8434(%rip)  # 0x341860# DISASM2-NEXT:             pushq $061# DISASM2-NEXT:             jmp 0x1310 <.plt>62# DISASM2-EMPTY:63# DISASM2-NEXT: <bar@plt>:64# DISASM2-NEXT:   1330:     jmpq *8426(%rip)  # 0x342065# DISASM2-NEXT:             pushq $166# DISASM2-NEXT:             jmp 0x1310 <.plt>67# DISASM2-NOT:  {{.}}68 69.global _start70.weak weak71 72_start:73  call local74  call bar75  jmp bar@plt76  jmp weak77 78## foo is local and non-preemptale, no PLT is generated.79local:80  ret81