2 # Check R_MIPS_GOT16 relocation against weak symbols.
4 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
5 # RUN: ld.lld %t.o -shared -o %t1.so
6 # RUN: llvm-readelf -r --dyn-syms --dynamic-table -A %t1.so \
7 # RUN: | FileCheck -check-prefixes=CHECK,NOSYM %s
8 # RUN: ld.lld %t.o -shared -Bsymbolic -o %t2.so
9 # RUN: llvm-readelf -r --dyn-syms --dynamic-table -A %t2.so \
10 # RUN: | FileCheck -check-prefixes=CHECK,SYM %s
12 # CHECK: Dynamic section
13 # CHECK: (MIPS_SYMTABNO) 4
14 # NOSYM: (MIPS_LOCAL_GOTNO) 2
15 # NOSYM: (MIPS_GOTSYM) 0x1
16 # SYM: (MIPS_LOCAL_GOTNO) 4
17 # SYM: (MIPS_GOTSYM) 0x3
19 # CHECK: There are no relocations in this file.
21 # CHECK: Symbol table '.dynsym'
22 # CHECK-DAG: [[FOO:[0-9a-f]+]] 0 NOTYPE WEAK DEFAULT 8 foo
23 # CHECK-DAG: 00000000 0 NOTYPE WEAK DEFAULT UND bar
24 # CHECK-DAG: [[SYM:[0-9a-f]+]] 0 NOTYPE GLOBAL DEFAULT 8 sym
27 # NOSYM-NOT: Local entries:
28 # NOSYM: Global entries:
29 # NOSYM-NEXT: Access Initial Sym.Val. Type Ndx Name
30 # NOSYM-NEXT: -32744(gp) [[FOO]] [[FOO]] NOTYPE 8 foo
31 # NOSYM-NEXT: -32740(gp) 00000000 00000000 NOTYPE UND bar
32 # NOSYM-NEXT: -32736(gp) [[SYM]] [[SYM]] NOTYPE 8 sym
36 # SYM-NEXT: Access Initial
37 # SYM-NEXT: -32744(gp) [[FOO]]
38 # SYM-NEXT: -32740(gp) [[SYM]]
39 # SYM: Global entries:
40 # SYM-NEXT: Access Initial Sym.Val. Type Ndx Name
41 # SYM-NEXT: -32736(gp) 00000000 00000000 NOTYPE UND bar