36 lines · plain
1# REQUIRES: ppc2 3## Ensure R_PPC_PLTREL retains .got even in the absence of4## .got/_GLOBAL_OFFSET_TABLE_ references.5 6# RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o7# RUN: ld.lld -shared %t.o -o %t.so8# RUN: llvm-readobj -Sdr %t.so | FileCheck %s9 10.section .got2,"aw",@progbits11.set .LTOC, .+0x800012 13.text14.L0:15addis 30,30,.LTOC-.L0@ha16addi 30,30,.LTOC-.L0@l17bl baz+0x8000@plt18 19## DT_PPC_GOT must point to .got, which must have the 12-byte header.20## The only relocation is an R_PPC_JMP_SLOT.21 22# CHECK: Sections [23# CHECK: Name: .got (24# CHECK: Address:25# CHECK-SAME: {{ }}[[#%x,GOT:]]26# CHECK: Size:27# CHECK-SAME: {{ 12$}}28# CHECK: DynamicSection [29# CHECK-NEXT: Tag Type Name/Value30# CHECK: 0x70000000 PPC_GOT [[#GOT]]31# CHECK: Relocations [32# CHECK-NEXT: Section ([[#]]) .rela.plt {33# CHECK-NEXT: 0x[[#%x,]] R_PPC_JMP_SLOT baz 0x034# CHECK-NEXT: }35# CHECK-NEXT: ]36