brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 1e232fa Raw
60 lines · plain
1# REQUIRES: ppc2## Test .got2 placed in a different output section.3 4# RUN: rm -rf %t && split-file %s %t5# RUN: llvm-mc -filetype=obj -triple=powerpc %t/a.s -o %t/a.o6# RUN: llvm-mc -filetype=obj -triple=powerpc %t/b.s -o %t/b.o7# RUN: ld.lld -shared -T %t/t %t/a.o %t/b.o -o %t/a.so8# RUN: llvm-readobj -r %t/a.so | FileCheck --check-prefix=RELOC %s9# RUN: llvm-readelf -S %t/a.so | FileCheck --check-prefix=SEC %s10 11# RELOC:      .rela.plt {12# RELOC-NEXT:   0x1A4 R_PPC_JMP_SLOT f 0x013# RELOC-NEXT: }14 15# SEC:      .got    PROGBITS 0000018c16# SEC-NEXT: .rodata PROGBITS 0000019817 18## .got2+0x8000-0xb0 = .rodata+4+0x8000-0xb0 = 0x198+4+0x8000-0xb0 = 65536*1-3253219# CHECK:      <_start>:20# CHECK-NEXT:          bcl 20, 31, 0x21# CHECK-NEXT:      b0: mflr 3022# CHECK-NEXT:          addis 30, 30, 123# CHECK-NEXT:          addi 30, 30, -3253224# CHECK-NEXT:          bl {{.*}} <00008000.got2.plt_pic32.f>25 26## &.got[2] - (.got2+0x8000) = &.got[2] - (.rodata+4+0x8000) = 0x1A4 - (0x198+4+0x8000) = -3276027# CHECK:      <00008000.got2.plt_pic32.f>:28# CHECK-NEXT:   lwz 11, -32760(30)29# CHECK-NEXT:   mtctr 1130# CHECK-NEXT:   bctr31# CHECK-NEXT:   nop32 33#--- a.s34.section .rodata.cst4,"aM",@progbits,435.long 136 37.section .got2,"aw"38.long f39 40.text41.globl _start, f, g42_start:43  bcl 20,31,.L44.L:45  mflr 3046  addis 30, 30, .got2+0x8000-.L@ha47  addi 30, 30, .got2+0x8000-.L@l48  bl f+0x8000@plt49 50#--- b.s51.section .got2,"aw"52.globl f53f:54  bl f+0x8000@plt55 56#--- t57SECTIONS {58  .rodata : { *(.rodata .rodata.*) *(.got2) }59}60