brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 93d2ced Raw
57 lines · plain
1# REQUIRES: mips2# Check R_MIPS_GOT16 relocation against weak symbols.3 4# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o5# RUN: ld.lld %t.o -shared -o %t1.so6# RUN: llvm-readelf -r --dyn-syms --dynamic-table -A %t1.so \7# RUN:   | FileCheck -check-prefixes=CHECK,NOSYM %s8# RUN: ld.lld %t.o -shared -Bsymbolic -o %t2.so9# RUN: llvm-readelf -r --dyn-syms --dynamic-table -A %t2.so \10# RUN:   | FileCheck -check-prefixes=CHECK,SYM %s11 12# CHECK: Dynamic section13# CHECK: (MIPS_SYMTABNO)      414# NOSYM: (MIPS_LOCAL_GOTNO)   215# NOSYM: (MIPS_GOTSYM)        0x116#   SYM: (MIPS_LOCAL_GOTNO)   417#   SYM: (MIPS_GOTSYM)        0x318 19# CHECK: There are no relocations in this file.20 21# CHECK: Symbol table '.dynsym'22# CHECK-DAG: [[FOO:[0-9a-f]+]]     0 NOTYPE  WEAK   DEFAULT    8 foo23# CHECK-DAG:          00000000     0 NOTYPE  WEAK   DEFAULT  UND bar24# CHECK-DAG: [[SYM:[0-9a-f]+]]     0 NOTYPE  GLOBAL DEFAULT    8 sym25 26# NOSYM:      Primary GOT:27# NOSYM-NOT:   Local entries:28# NOSYM:       Global entries:29# NOSYM-NEXT:       Access  Initial Sym.Val. Type    Ndx Name30# NOSYM-NEXT:   -32744(gp)  [[FOO]]  [[FOO]] NOTYPE    8 foo31# NOSYM-NEXT:   -32740(gp) 00000000 00000000 NOTYPE  UND bar32# NOSYM-NEXT:   -32736(gp)  [[SYM]]  [[SYM]] NOTYPE    8 sym33 34# SYM:      Primary GOT:35# SYM:       Local entries:36# SYM-NEXT:       Access  Initial37# SYM-NEXT:   -32744(gp)  [[FOO]]38# SYM-NEXT:   -32740(gp)  [[SYM]]39# SYM:       Global entries:40# SYM-NEXT:       Access  Initial Sym.Val. Type    Ndx Name41# SYM-NEXT:   -32736(gp) 00000000 00000000 NOTYPE  UND bar42 43  .text44  .global  sym45  .weak    foo,bar46func:47  lw      $t0,%got(foo)($gp)48  lw      $t0,%got(bar)($gp)49  lw      $t0,%got(sym)($gp)50 51  .data52  .weak foo53foo:54  .word 055sym:56  .word 057