[Mips] Check initialization of _gp_disp and _GLOBAL_OFFSET_TABLE_

symbols in case of executable file linking.

llvm-svn: 199238
This commit is contained in:
Simon Atanasyan 2014-01-14 18:19:42 +00:00
parent 6cac582de5
commit 3b1a761374
2 changed files with 28 additions and 11 deletions

View File

@ -1,11 +0,0 @@
# Check _gp_disp and GOT_OFFSET_TABLE value
RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec \
RUN: -o %t %p/Inputs/dynobj.o
RUN: llvm-objdump -section-headers -t %t | FileCheck %s
CHECK: Idx Name Size Address Type
CHECK: 7 .got 0000001c 0000000000001000 DATA
CHECK: SYMBOL TABLE:
CHECK: 00001000 g *ABS* 00000000 _GLOBAL_OFFSET_TABLE_
CHECK: 00008ff0 g *ABS* 00000000 _gp_disp

View File

@ -0,0 +1,28 @@
# Check _gp_disp and GOT_OFFSET_TABLE value
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t1 %s
# RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec -o %t2 %t1
# RUN: llvm-objdump -section-headers -t %t2 | FileCheck -check-prefix=SHARED %s
# SHARED: Sections:
# SHARED: Idx Name Size Address Type
# SHARED: 6 .got 00000008 0000000000001000 DATA
# SHARED: SYMBOL TABLE:
# SHARED: 00001000 g *ABS* 00000000 _GLOBAL_OFFSET_TABLE_
# SHARED: 00008ff0 g *ABS* 00000000 _gp_disp
# RUN: lld -flavor gnu -target mipsel -e main --noinhibit-exec -o %t2 %t1
# RUN: llvm-objdump -section-headers -t %t2 | FileCheck -check-prefix=EXE %s
# EXE: Sections:
# EXE: Idx Name Size Address Type
# EXE: 7 .got 00000008 0000000000401000 DATA
# EXE: SYMBOL TABLE:
# EXE: 00401000 g *ABS* 00000000 _GLOBAL_OFFSET_TABLE_
# EXE: 00408ff0 g *ABS* 00000000 _gp_disp
.global main
.ent main
main:
nop
.end main