120 lines
2.9 KiB
Plaintext
120 lines
2.9 KiB
Plaintext
# Check that .MIPS.options section gets register usage mask from "used" files
|
|
# only. In this test case we take only t2.o from liboptions.a and should not
|
|
# add register usage masks from t1.o to the output .MIPS.options section.
|
|
|
|
# RUN: yaml2obj -format=elf -docnum 1 %s > %t1.o
|
|
# RUN: yaml2obj -format=elf -docnum 2 %s > %t2.o
|
|
# RUN: llvm-ar q %T/liboptions.a %t1.o %t2.o
|
|
# RUN: yaml2obj -format=elf -docnum 3 %s > %t3.o
|
|
# RUN: lld -flavor old-gnu -target mips64el -e T0 -o %t.exe %t3.o -L%T -loptions
|
|
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
|
|
|
|
# CHECK: Contents of section .MIPS.options:
|
|
# CHECK-NEXT: {{[0-9a-f]+}} 01280000 00000000 66666666 00000000
|
|
# CHECK-NEXT: {{[0-9a-f]+}} 66666666 66666666 66666666 66666666
|
|
# CHECK-NEXT: {{[0-9a-f]+}} f08f0020 01000000
|
|
|
|
# CHECK: SYMBOL TABLE:
|
|
# CHECK: 20008ff0 g *ABS* 00000000 _gp
|
|
|
|
# t1.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ARCH_64R2]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Size: 4
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .MIPS.options
|
|
Type: SHT_MIPS_OPTIONS
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 8
|
|
Content: "01280000000000001111111100000000111111111111111111111111111111110010000000000000"
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T1
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 4
|
|
|
|
# t2.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ARCH_64R2]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Size: 4
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .MIPS.options
|
|
Type: SHT_MIPS_OPTIONS
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 8
|
|
Content: "01280000000000002222222200000000222222222222222222222222222222220010000000000000"
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T2
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 4
|
|
|
|
# t3.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_PIC, EF_MIPS_ARCH_64R2]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Size: 4
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .rel.text
|
|
Type: SHT_REL
|
|
Info: .text
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0
|
|
Symbol: T2
|
|
Type: R_MIPS_32
|
|
|
|
- Name: .MIPS.options
|
|
Type: SHT_MIPS_OPTIONS
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 8
|
|
Content: "01280000000000004444444400000000444444444444444444444444444444440010000000000000"
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T0
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 4
|
|
- Name: T2
|
|
...
|