49 lines · plain
1# RUN: llvm-mc -triple=powerpc64-unknown-linux-gnu -filetype=obj %s | \2# RUN: llvm-readobj -rs - | FileCheck %s3 4 .section .opd,"aw",@progbits5access_int64:6 .quad .L.access_int647 .quad .TOC.@tocbase8 .quad 09 .text10.L.access_int64:11 ld 4, .LC1@toc(2)12 bl sin13 14 .section .toc,"aw",@progbits15.LC1:16 .tc number64[TC],number6417 .data18 .globl number6419number64:20 .quad 1021 22# CHECK: Relocations [23 24# The relocations in .rela.text are the 'number64' load using a25# R_PPC64_TOC16_DS against the .toc and the 'sin' external function26# address using a R_PPC64_REL2427# CHECK: Section ({{[0-9]+}}) .rela.text {28# CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_TOC16_DS .toc29# CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_REL24 sin30# CHECK-NEXT: }31 32# The .opd entry for the 'access_int64' function creates 2 relocations:33# 1. A R_PPC64_ADDR64 against the .text segment plus addend (the function34# address itself);35# 2. And a R_PPC64_TOC against no symbol (the linker will replace for the36# module's TOC base).37# CHECK: Section ({{[0-9]+}}) .rela.opd {38# CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_ADDR64 .text 0x039# CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_TOC - 0x040 41# Finally the TOC creates the relocation for the 'number64'.42# CHECK: Section ({{[0-9]+}}) .rela.toc {43# CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_ADDR64 number64 0x044# CHECK-NEXT: }45 46# CHECK-NEXT: ]47# CHECK: Symbols [48# CHECK: .TOC.49