Files
clang-p2996/lld/test/elf/Mips/dynlib-dynamic.test
Simon Atanasyan 9931f95bac Linking of shared libraries for MIPS little-endian 32-bit target.
The following are the most significant peculiarities of MIPS target:
- MIPS ABI requires some special tags in the dynamic table.
- GOT consists of two parts local and global. The local part contains
  entries refer locally visible symbols. The global part contains entries
  refer global symbols.
- Entries in the .dynsym section which have corresponded entries in the
  GOT should be:
  * Emitted at the end of .dynsym section
  * Sorted accordingly to theirs GOT counterparts
- There are "paired" relocations. One or more R_MIPS_HI16 and R_MIPS_GOT16
  relocations should be followed by R_MIPS_LO16 relocation. To calculate
  result of R_MIPS_HI16 and R_MIPS_GOT16 relocations we need to combine
  addends from these relocations and paired R_MIPS_LO16 relocation.

The patch reviewed by Michael Spencer, Shankar Easwaran, Rui Ueyama.
http://llvm-reviews.chandlerc.com/D2156

llvm-svn: 197342
2013-12-15 12:57:28 +00:00

28 lines
1.1 KiB
Plaintext

# Check MIPS specific tags in the dynamic table.
RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec \
RUN: -o %t %p/Inputs/dynobj.o
RUN: llvm-readobj -dynamic-table %t | FileCheck %s
CHECK: Format: ELF32-mips
CHECK: Arch: mipsel
CHECK: AddressSize: 32bit
CHECK: LoadName:
CHECK: DynamicSection [ (15 entries)
CHECK: Tag Type Name/Value
CHECK: 0x00000004 HASH 0xE0
CHECK: 0x00000005 STRTAB 0x158
CHECK: 0x00000006 SYMTAB 0x108
CHECK: 0x0000000A STRSZ 17 (bytes)
CHECK: 0x0000000B SYMENT 16 (bytes)
CHECK: 0x0000001A FINI_ARRAY 0x0
CHECK: 0x0000001C FINI_ARRAYSZ 0 (bytes)
CHECK: 0x70000001 MIPS_RLD_VERSION 1
CHECK: 0x70000005 MIPS_FLAGS 0x2
CHECK: 0x70000006 MIPS_BASE_ADDRESS 0x0
CHECK: 0x7000000A MIPS_LOCAL_GOTNO 4
CHECK: 0x70000011 MIPS_SYMTABNO 5
CHECK: 0x70000013 MIPS_GOTSYM 0x2
CHECK: 0x00000003 PLTGOT 0x1000
CHECK: 0x00000000 NULL 0x0
CHECK: ]