Files
clang-p2996/lld/test/elf/Mips/initfini-micro.test
Simon Atanasyan 87a559212b [ELF] Allow target to adjust a symbol's value for using in a dynamic tag
Some targets like microMIPS and ARM Thumb use the last bit of a symbol's
value to mark 'compressed' code. This patch adds new virtual function
`DynamicTable::getAtomVirtualAddress` which allows to adjust a symbol's
value before using it in a dynamic table tags like DT_INIT / DT_FINI.

llvm-svn: 223963
2014-12-10 20:09:12 +00:00

46 lines
1.2 KiB
Plaintext

# Check that if _init/_fini symbols are microMIPS encoded, DT_INIT/DT_FINI tags
# use adjusted values with set the last bit.
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target mipsel -shared -o %t.so %t.o
# RUN: llvm-readobj -symbols -dynamic-table %t.so | FileCheck %s
# CHECK: Name: _init (1)
# CHECK-NEXT: Value: 0xF5
# CHECK: Name: _fini (7)
# CHECK-NEXT: Value: 0xF9
#
# CHECK: 0x0000000C INIT 0xF5
# CHECK: 0x0000000D FINI 0xF9
---
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2, EF_MIPS_MICROMIPS ]
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x04
Size: 0x18
Symbols:
Global:
- Name: _init
Type: STT_FUNC
Section: .text
Value: 0x0
Size: 0x4
Other: [ STO_MIPS_MICROMIPS ]
- Name: _fini
Type: STT_FUNC
Section: .text
Value: 0x4
Size: 0x4
Other: [ STO_MIPS_MICROMIPS ]
...