forked from OSchip/llvm-project
108 lines
2.2 KiB
Plaintext
108 lines
2.2 KiB
Plaintext
|
# Conditions:
|
||
|
# a) Linking a non-shared executable file.
|
||
|
# b) Relocations' targets are undefined symbols.
|
||
|
# Check:
|
||
|
# a) There should be no dynamic relocations.
|
||
|
# b) There should be no PLT entries.
|
||
|
#
|
||
|
# RUN: yaml2obj -format=elf %s > %t-obj
|
||
|
# RUN: lld -flavor gnu -target mipsel --noinhibit-exec -e T0 -o %t2-exe %t-obj
|
||
|
# RUN: llvm-readobj -dt -r -s %t2-exe | FileCheck -check-prefix=PLT-SYM %s
|
||
|
|
||
|
# PLT-SYM: Sections [
|
||
|
# PLT-SYM: Section {
|
||
|
# PLT-SYM-NOT: Name: .plt ({{[0-9]+}})
|
||
|
|
||
|
# PLT-SYM: Relocations [
|
||
|
# PLT-SYM-NEXT: ]
|
||
|
|
||
|
# PLT-SYM: DynamicSymbols [
|
||
|
# PLT-SYM-NEXT: Symbol {
|
||
|
# PLT-SYM-NEXT: Name: @ (0)
|
||
|
# PLT-SYM-NEXT: Value: 0x0
|
||
|
# PLT-SYM-NEXT: Size: 0
|
||
|
# PLT-SYM-NEXT: Binding: Local (0x0)
|
||
|
# PLT-SYM-NEXT: Type: None (0x0)
|
||
|
# PLT-SYM-NEXT: Other: 0
|
||
|
# PLT-SYM-NEXT: Section: Undefined (0x0)
|
||
|
# PLT-SYM-NEXT: }
|
||
|
# PLT-SYM-NEXT: ]
|
||
|
|
||
|
!ELF
|
||
|
FileHeader: !FileHeader
|
||
|
Class: ELFCLASS32
|
||
|
Data: ELFDATA2LSB
|
||
|
Type: ET_REL
|
||
|
Machine: EM_MIPS
|
||
|
Flags: [EF_MIPS_CPIC]
|
||
|
|
||
|
Sections:
|
||
|
- Name: .text
|
||
|
Type: SHT_PROGBITS
|
||
|
Content: "0000000000000000"
|
||
|
AddressAlign: 16
|
||
|
Flags: [SHF_EXECINSTR, SHF_ALLOC]
|
||
|
|
||
|
- Name: .data
|
||
|
Type: SHT_PROGBITS
|
||
|
Content: "0000000000000000"
|
||
|
AddressAlign: 16
|
||
|
Flags: [SHF_WRITE, SHF_ALLOC]
|
||
|
|
||
|
- Name: .rel.text
|
||
|
Type: SHT_REL
|
||
|
Info: .text
|
||
|
AddressAlign: 4
|
||
|
Relocations:
|
||
|
- Offset: 0x04
|
||
|
Symbol: T3
|
||
|
Type: R_MIPS_26
|
||
|
|
||
|
- Name: .rel.data
|
||
|
Type: SHT_REL
|
||
|
Info: .data
|
||
|
AddressAlign: 4
|
||
|
Relocations:
|
||
|
- Offset: 0x00
|
||
|
Symbol: T1
|
||
|
Type: R_MIPS_HI16
|
||
|
- Offset: 0x00
|
||
|
Symbol: T1
|
||
|
Type: R_MIPS_LO16
|
||
|
- Offset: 0x04
|
||
|
Symbol: T2
|
||
|
Type: R_MIPS_32
|
||
|
|
||
|
- Offset: 0x04
|
||
|
Symbol: D1
|
||
|
Type: R_MIPS_HI16
|
||
|
- Offset: 0x04
|
||
|
Symbol: D1
|
||
|
Type: R_MIPS_LO16
|
||
|
- Offset: 0x04
|
||
|
Symbol: D2
|
||
|
Type: R_MIPS_32
|
||
|
|
||
|
Symbols:
|
||
|
Global:
|
||
|
- Name: T0
|
||
|
Section: .text
|
||
|
Type: STT_FUNC
|
||
|
Value: 0x0
|
||
|
Size: 8
|
||
|
- Name: T1
|
||
|
Type: STT_FUNC
|
||
|
- Name: T2
|
||
|
Type: STT_FUNC
|
||
|
- Name: T3
|
||
|
Type: STT_FUNC
|
||
|
- Name: D0
|
||
|
Section: .data
|
||
|
Type: STT_OBJECT
|
||
|
Value: 0x0
|
||
|
Size: 8
|
||
|
- Name: D1
|
||
|
Type: STT_OBJECT
|
||
|
- Name: D2
|
||
|
Type: STT_OBJECT
|