• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: mips
2# Check number of redundant entries in the local part of MIPS GOT.
3
4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5# RUN: ld.lld %t.o -shared -o %t.so
6# RUN: llvm-readelf -s -A %t.so | FileCheck %s
7
8# CHECK: Symbol table '.symtab'
9# CHECK: {{.*}}: [[VAL:[0-9a-f]+]]  {{.*}}  glb1
10
11# CHECK:      Primary GOT:
12# CHECK:       Local entries:
13# CHECK-NEXT:    Address     Access  Initial
14# CHECK-NEXT:     {{.*}} -32744(gp) 00020000
15# CHECK-NEXT:     {{.*}} -32740(gp) 00030000
16# CHECK-NEXT:     {{.*}} -32736(gp) 00040000
17# CHECK-NEXT:     {{.*}} -32732(gp) [[VAL]]
18# CHECK-NOT:      {{.*}} -32728(gp)
19
20  .text
21  .globl  foo
22foo:
23  lw      $t0, %got(loc1)($gp)
24  addi    $t0, $t0, %lo(loc1)
25  lw      $t0, %got(loc2)($gp)
26  addi    $t0, $t0, %lo(loc2)
27  lw      $t0, %got(loc3)($gp)
28  addi    $t0, $t0, %lo(loc3)
29  lw      $t0, %got(loc4)($gp)
30  addi    $t0, $t0, %lo(loc4)
31  lw      $t0, %got(glb1)($gp)
32  lw      $t0, %got(glb1)($gp)
33
34  .section .data.1,"aw",%progbits
35loc1:
36  .space 0x10000
37loc2:
38  .word 0
39loc3:
40  .word 0
41  .global glb1
42  .hidden glb1
43glb1:
44  .word 0
45
46  .section .data.2,"aw",%progbits
47loc4:
48  .word 0
49