39 lines · plain
1# REQUIRES: mips2# Check creation of GOT entries for global symbols in case of executable3# file linking. Symbols defined in DSO should get entries in the global part4# of the GOT. Symbols defined in the executable itself should get local GOT5# entries and does not need a row in .dynsym table.6 7# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \8# RUN: %S/Inputs/mips-dynamic.s -o %t.so.o9# RUN: ld.lld -shared %t.so.o -o %t.so10# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o11# RUN: ld.lld %t.o %t.so -o %t.exe12# RUN: llvm-readelf --dyn-syms --symbols -A %t.exe | FileCheck %s13 14# CHECK: Symbol table '.dynsym'15# CHECK-NOT: bar16 17# CHECK: Symbol table '.symtab'18# CHECK: {{.*}}: [[BAR:[0-9a-f]+]] {{.*}} bar19# CHECK: {{.*}}: 00000000 {{.*}} _foo20 21# CHECK: Primary GOT:22# CHECK: Local entries:23# CHECK-NEXT: Address Access Initial24# CHECK-NEXT: {{.*}} -32744(gp) [[BAR]]25# CHECK-EMPTY:26# CHECK-NEXT: Global entries:27# CHECK-NEXT: Address Access Initial Sym.Val. Type Ndx Name28# CHECK-NEXT: {{.*}} -32740(gp) 00000000 00000000 NOTYPE UND _foo29 30 .text31 .globl __start32__start:33 lw $t0,%got(bar)($gp)34 lw $t0,%got(_foo)($gp)35 36.global bar37bar:38 .word 039