2 # Check the primary GOT cannot be made to overflow
4 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
5 # RUN: %p/Inputs/mips-64-got-load.s -o %t1.so.o
6 # RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t2.so.o
7 # RUN: ld.lld -shared -mips-got-size 32 %t1.so.o %t2.so.o -o %t-sgot.so
8 # RUN: ld.lld -shared -mips-got-size 24 %t1.so.o %t2.so.o -o %t-mgot.so
9 # RUN: llvm-readelf -s -A %t-sgot.so | FileCheck -check-prefixes=SYM,SGOT %s
10 # RUN: llvm-readelf -s -A %t-mgot.so | FileCheck -check-prefixes=SYM,MGOT %s
12 # SYM: Symbol table '.symtab'
13 # SYM: {{.*}}: [[LOC1:[0-9a-f]+]] {{.*}} local1
14 # SYM: {{.*}}: [[LOC2:[0-9a-f]+]] {{.*}} local2
17 # SGOT-NEXT: Canonical gp value:
19 # SGOT-NEXT: Reserved entries:
20 # SGOT-NEXT: Address Access Initial Purpose
21 # SGOT-NEXT: {{.*}} -32752(gp) 0000000000000000 Lazy resolver
22 # SGOT-NEXT: {{.*}} -32744(gp) 8000000000000000 Module pointer (GNU extension)
24 # SGOT-NEXT: Local entries:
25 # SGOT-NEXT: Address Access Initial
26 # SGOT-NEXT: {{.*}} -32736(gp) [[LOC1]]
27 # SGOT-NEXT: {{.*}} -32728(gp) [[LOC2]]
30 # MGOT-NEXT: Canonical gp value:
32 # MGOT-NEXT: Reserved entries:
33 # MGOT-NEXT: Address Access Initial Purpose
34 # MGOT-NEXT: {{.*}} -32752(gp) 0000000000000000 Lazy resolver
35 # MGOT-NEXT: {{.*}} -32744(gp) 8000000000000000 Module pointer (GNU extension)
37 # MGOT-NEXT: Local entries:
38 # MGOT-NEXT: Address Access Initial
39 # MGOT-NEXT: {{.*}} -32736(gp) [[LOC1]]
41 # MGOT-NEXT: Number of TLS and multi-GOT entries 1
46 ld $
2, %got_disp
(local2
)($gp
)