forked from OSchip/llvm-project
44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
# Check _gp_disp and GOT_OFFSET_TABLE value
|
|
#
|
|
# RUN: yaml2obj -format=elf %s > %t.o
|
|
# RUN: lld -flavor old-gnu -target mipsel -shared --noinhibit-exec -o %t.so %t.o
|
|
# RUN: llvm-objdump -h -t %t.so | FileCheck -check-prefix=SHARED %s
|
|
|
|
# SHARED: Sections:
|
|
# SHARED: Idx Name Size Address Type
|
|
# SHARED: 6 .got 00000008 0000000000001000 DATA
|
|
# SHARED: SYMBOL TABLE:
|
|
# SHARED: 00001000 .got 00000000 _GLOBAL_OFFSET_TABLE_
|
|
# SHARED: 00008ff0 g *ABS* 00000000 _gp
|
|
# SHARED: 00008ff0 g *ABS* 00000000 _gp_disp
|
|
|
|
# RUN: lld -flavor old-gnu -target mipsel -e main --noinhibit-exec -o %t.exe %t.o
|
|
# RUN: llvm-objdump -h -t %t.exe | FileCheck -check-prefix=EXE %s
|
|
|
|
# EXE: Sections:
|
|
# EXE: Idx Name Size Address Type
|
|
# EXE: 7 .got 00000008 0000000000401000 DATA
|
|
# EXE: SYMBOL TABLE:
|
|
# EXE: 00401000 .got 00000000 _GLOBAL_OFFSET_TABLE_
|
|
# EXE: 00408ff0 g *ABS* 00000000 _gp
|
|
# EXE: 00408ff0 g *ABS* 00000000 _gp_disp
|
|
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [ EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
AddressAlign: 0x10
|
|
Size: 0x04
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: main
|
|
Section: .text
|