1// REQUIRES: x86 2// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o 3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t2.o 4// RUN: ld.lld -shared %t2.o -o %t2.so 5 6// RUN: echo "SECTIONS { \ 7// RUN: .text : { *(.text) } \ 8// RUN: .plt : { *(.plt) } \ 9// RUN: .got.plt : { *(.got.plt) } \ 10// RUN: .dynstr : { *(.dynstr) } \ 11// RUN: }" > %t.script 12// RUN: ld.lld -shared %t1.o %t2.so -o %t.exe -z retpolineplt --script %t.script 13// RUN: llvm-objdump -d -s %t.exe | FileCheck %s 14 15// CHECK: Disassembly of section .plt: 16// CHECK-EMPTY: 17// CHECK-NEXT: <.plt>: 18// CHECK-NEXT: 10: ff 35 32 01 00 00 pushq 306(%rip) 19// CHECK-NEXT: 16: 4c 8b 1d 33 01 00 00 movq 307(%rip), %r11 20// CHECK-NEXT: 1d: e8 0e 00 00 00 callq 0x30 <.plt+0x20> 21// CHECK-NEXT: 22: f3 90 pause 22// CHECK-NEXT: 24: 0f ae e8 lfence 23// CHECK-NEXT: 27: eb f9 jmp 0x22 <.plt+0x12> 24// CHECK-NEXT: 29: cc int3 25// CHECK-NEXT: 2a: cc int3 26// CHECK-NEXT: 2b: cc int3 27// CHECK-NEXT: 2c: cc int3 28// CHECK-NEXT: 2d: cc int3 29// CHECK-NEXT: 2e: cc int3 30// CHECK-NEXT: 2f: cc int3 31// CHECK-NEXT: 30: 4c 89 1c 24 movq %r11, (%rsp) 32// CHECK-NEXT: 34: c3 retq 33// CHECK-NEXT: 35: cc int3 34// CHECK-NEXT: 36: cc int3 35// CHECK-NEXT: 37: cc int3 36// CHECK-NEXT: 38: cc int3 37// CHECK-NEXT: 39: cc int3 38// CHECK-NEXT: 3a: cc int3 39// CHECK-NEXT: 3b: cc int3 40// CHECK-NEXT: 3c: cc int3 41// CHECK-NEXT: 3d: cc int3 42// CHECK-NEXT: 3e: cc int3 43// CHECK-NEXT: 3f: cc int3 44// CHECK-NEXT: 40: 4c 8b 1d 11 01 00 00 movq 273(%rip), %r11 45// CHECK-NEXT: 47: e8 e4 ff ff ff callq 0x30 <.plt+0x20> 46// CHECK-NEXT: 4c: e9 d1 ff ff ff jmp 0x22 <.plt+0x12> 47// CHECK-NEXT: 51: 68 00 00 00 00 pushq $0 48// CHECK-NEXT: 56: e9 b5 ff ff ff jmp 0x10 <.plt> 49// CHECK-NEXT: 5b: cc int3 50// CHECK-NEXT: 5c: cc int3 51// CHECK-NEXT: 5d: cc int3 52// CHECK-NEXT: 5e: cc int3 53// CHECK-NEXT: 5f: cc int3 54// CHECK-NEXT: 60: 4c 8b 1d f9 00 00 00 movq 249(%rip), %r11 55// CHECK-NEXT: 67: e8 c4 ff ff ff callq 0x30 <.plt+0x20> 56// CHECK-NEXT: 6c: e9 b1 ff ff ff jmp 0x22 <.plt+0x12> 57// CHECK-NEXT: 71: 68 01 00 00 00 pushq $1 58// CHECK-NEXT: 76: e9 95 ff ff ff jmp 0x10 <.plt> 59// CHECK-NEXT: 7b: cc int3 60// CHECK-NEXT: 7c: cc int3 61// CHECK-NEXT: 7d: cc int3 62// CHECK-NEXT: 7e: cc int3 63// CHECK-NEXT: 7f: cc int3 64 65.global _start 66_start: 67 jmp bar@PLT 68 jmp zed@PLT 69