245 lines · plain
1# REQUIRES: system-linux2# RUN: rm -rf %t && mkdir -p %t3# RUN: llvm-mc -triple=systemz-unknown-linux -position-independent \4# RUN: -filetype=obj -o %t/elf_reloc.o %s5#6# RUN: llvm-jitlink -noexec \7# RUN: -slab-allocate 100Kb -slab-address 0x6ff00000 -slab-page-size 4096 \8# RUN: -abs foo=0x6ff04040 \9# RUN: -abs bar=0x6ff04048 \10# RUN: %t/elf_reloc.o -check %s11 12# Verifying GOT related relocations.13 14 .text15 .globl main16 .type main,@function17main:18# jitlink-check: decode_operand(main, 1) = _GLOBAL_OFFSET_TABLE_ - main 19 larl %r12, _GLOBAL_OFFSET_TABLE_20 .globl test_gotent_foo21test_gotent_foo:22# jitlink-check: decode_operand(test_gotent_foo, 1) = \23# jitlink-check: (got_addr(elf_reloc.o, foo) - test_gotent_foo)24 .reloc .+2, R_390_GOTENT, foo+225 larl %r1, 026 .size test_gotent_foo, .-test_gotent_foo27 28 .globl test_gotent_bar29test_gotent_bar:30# jitlink-check: decode_operand(test_gotent_bar, 1) = \31# jitlink-check: (got_addr(elf_reloc.o, bar) - test_gotent_bar) 32 .reloc .+2, R_390_GOTENT, bar+233 larl %r1, 034 .size test_gotent_bar, .-test_gotent_bar35 36 .globl test_gotpltent_foo37test_gotpltent_foo:38# jitlink-check: decode_operand(test_gotpltent_foo, 1) = \39# jitlink-check: (got_addr(elf_reloc.o, foo) - test_gotpltent_foo)40 .reloc .+2, R_390_GOTPLTENT, foo+241 larl %r1, 042 .size test_gotpltent_foo, .-test_gotpltent_foo43 44 .globl test_gotpltent_bar45test_gotpltent_bar:46# jitlink-check: decode_operand(test_gotpltent_bar, 1) = \47# jitlink-check: (got_addr(elf_reloc.o, bar) - test_gotpltent_bar)48 .reloc .+2, R_390_GOTPLTENT, bar+249 larl %r1, 050 .size test_gotpltent_bar, .-test_gotpltent_bar51 52 .globl test_got12_foo53test_got12_foo:54# jitlink-check: decode_operand(test_got12_foo, 2) = \55# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)56 .reloc .+2, R_390_GOT12, foo57 l %r1, 0(%r12)58 .size test_got12_foo, .-test_got12_foo59 60 .globl test_got12_bar61test_got12_bar:62# jitlink-check: decode_operand(test_got12_bar, 2) = \63# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)64 .reloc .+2, R_390_GOT12, bar65 l %r1, 0(%r12)66 .size test_got12_bar, .-test_got12_bar67 68 .globl test_gotplt12_foo69test_gotplt12_foo:70# jitlink-check: decode_operand(test_gotplt12_foo, 2) = \71# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)72 .reloc .+2, R_390_GOTPLT12, foo73 l %r1, 0(%r12)74 .size test_gotplt12_foo, .-test_gotplt12_foo75 76 .globl test_gotplt12_bar77test_gotplt12_bar:78# jitlink-check: decode_operand(test_gotplt12_bar, 2) = \79# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)80 .reloc .+2, R_390_GOTPLT12, bar 81 l %r1, 0(%r12)82 .size test_gotplt12_bar, .-test_gotplt12_bar83 84 .globl test_got20_foo85test_got20_foo:86# jitlink-check: decode_operand(test_got20_foo, 2) = \87# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)88 .reloc .+2, R_390_GOT20, foo89 lg %r1, 0(%r12)90 .size test_got20_foo, .-test_got20_foo91 92 .globl test_got20_bar93test_got20_bar:94# jitlink-check: decode_operand(test_got20_bar, 2) = \95# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)96 .reloc .+2, R_390_GOT20, bar97 lg %r1, 0(%r12)98 .size test_got20_bar, .-test_got20_bar99 100 .globl test_gotplt20_foo101test_gotplt20_foo:102# jitlink-check: decode_operand(test_gotplt20_foo, 2) = \103# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)104 .reloc .+2, R_390_GOTPLT20, foo105 lg %r1, 0(%r12)106 .size test_gotplt20_foo, .-test_gotplt20_foo107 108 .globl test_gotplt20_bar109test_gotplt20_bar:110# jitlink-check: decode_operand(test_gotplt20_bar, 2) = \111# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)112 .reloc .+2, R_390_GOTPLT20, bar113 lg %r1, 0(%r12)114 .size test_gotplt20_bar, .-test_gotplt20_bar115 br %r14116 .size main, .-main117 118 .data119 .globl test_got16_foo120# jitlink-check: *{2}test_got16_foo = \121# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)122test_got16_foo:123 .reloc ., R_390_GOT16, foo124 .space 2125 .size test_got16_foo, .-test_got16_foo126 127 .globl test_got16_bar128# jitlink-check: *{2}test_got16_bar = \129# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)130test_got16_bar:131 .reloc ., R_390_GOT16, bar132 .space 2133 .size test_got16_bar, .-test_got16_bar134 135 .globl test_gotplt16_foo136# jitlink-check: *{2}test_gotplt16_foo = \137# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)138test_gotplt16_foo:139 .reloc ., R_390_GOTPLT16, foo140 .space 2141 .size test_gotplt16_foo, .-test_gotplt16_foo142 143 .globl test_gotplt16_bar144# jitlink-check: *{2}test_gotplt16_bar = \145# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)146test_gotplt16_bar:147 .reloc ., R_390_GOTPLT16, bar148 .space 2149 .size test_gotplt16_bar, .-test_gotplt16_bar150 151 .globl test_got32_foo152# jitlink-check: *{4}test_got32_foo = \153# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)154test_got32_foo:155 .reloc ., R_390_GOT32, foo156 .space 4 157 .size test_got32_foo, .-test_got32_foo158 159 .globl test_got32_bar160# jitlink-check: *{4}test_got32_bar = \161# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)162test_got32_bar:163 .reloc ., R_390_GOT32, bar164 .space 4 165 .size test_got32_bar, .-test_got32_bar166 167 .globl test_gotplt32_foo168# jitlink-check: *{4}test_gotplt32_foo = \169# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)170test_gotplt32_foo:171 .reloc ., R_390_GOTPLT32, foo172 .space 4 173 .size test_gotplt32_foo, .-test_gotplt32_foo174 175 .globl test_gotplt32_bar176# jitlink-check: *{4}test_gotplt32_bar = \177# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)178test_gotplt32_bar:179 .reloc ., R_390_GOTPLT32, bar180 .space 4 181 .size test_gotplt32_bar, .-test_gotplt32_bar182 183 .globl test_got64_foo184# jitlink-check: *{8}test_got64_foo = \185# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)186test_got64_foo:187 .reloc ., R_390_GOT64, foo188 .space 8 189 .size test_got64_foo, .-test_got64_foo190 191 .globl test_got64_bar192# jitlink-check: *{8}test_got64_bar = \193# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)194test_got64_bar:195 .reloc ., R_390_GOT64, bar196 .space 8 197 .size test_got64_bar, .-test_got64_bar198 199 .globl test_gotplt64_foo200# jitlink-check: *{8}test_gotplt64_foo = \201# jitlink-check: (got_addr(elf_reloc.o, foo) - _GLOBAL_OFFSET_TABLE_)202test_gotplt64_foo:203 .reloc ., R_390_GOTPLT64, foo204 .space 8 205 .size test_gotplt64_foo, .-test_gotplt64_foo206 207 .globl test_gotplt64_bar208# jitlink-check: *{8}test_gotplt64_bar = \209# jitlink-check: (got_addr(elf_reloc.o, bar) - _GLOBAL_OFFSET_TABLE_)210test_gotplt64_bar:211 .reloc ., R_390_GOTPLT64, bar212 .space 8 213 .size test_gotplt64_bar, .-test_gotplt64_bar214 215 .globl test_gotpc_foo216# jitlink-check: *{4}test_gotpc_foo = _GLOBAL_OFFSET_TABLE_ - test_gotpc_foo217test_gotpc_foo:218 .reloc ., R_390_GOTPC, foo219 .space 4 220 .size test_gotpc_foo, .-test_gotpc_foo221 222 .globl test_gotpc_bar223# jitlink-check: *{4}test_gotpc_bar = _GLOBAL_OFFSET_TABLE_ - test_gotpc_bar224test_gotpc_bar:225 .reloc ., R_390_GOTPC, bar 226 .space 4227 .size test_gotpc_bar, .-test_gotpc_bar228 229 .globl test_gotpcdbl_foo230# jitlink-check: *{4}test_gotpcdbl_foo = \231# jitlink-check: (_GLOBAL_OFFSET_TABLE_ - test_gotpcdbl_foo) >> 1232test_gotpcdbl_foo:233 .reloc ., R_390_GOTPCDBL, foo234 .space 4235 .size test_gotpcdbl_foo, .-test_gotpcdbl_foo236 237 .globl test_gotpcdbl_bar238# jitlink-check: *{4}test_gotpcdbl_bar = \239# jitlink-check: (_GLOBAL_OFFSET_TABLE_ - test_gotpcdbl_bar) >> 1240test_gotpcdbl_bar:241 .reloc ., R_390_GOTPCDBL, bar242 .space 4243 .size test_gotpcdbl_bar, .-test_gotpcdbl_bar244 245