forked from OSchip/llvm-project
124 lines
2.8 KiB
Plaintext
124 lines
2.8 KiB
Plaintext
# Check that .reginfo section gets register usage mask from "used" files only.
|
|
# In this test case we take only t2.o from libreginfo.a and should not add
|
|
# register usage masks from t1.o to the output .reginfo section.
|
|
|
|
# RUN: yaml2obj -format=elf -docnum 1 %s > %t1.o
|
|
# RUN: yaml2obj -format=elf -docnum 2 %s > %t2.o
|
|
# RUN: llvm-ar q %T/libreginfo.a %t1.o %t2.o
|
|
# RUN: yaml2obj -format=elf -docnum 3 %s > %t3.o
|
|
# RUN: lld -flavor old-gnu -target mipsel -e T0 -o %t.exe %t3.o -L%T -lreginfo
|
|
# RUN: llvm-readobj -t -mips-reginfo %t.exe | FileCheck %s
|
|
|
|
# CHECK: Name: _gp
|
|
# CHECK-NEXT: 0x408FF0
|
|
|
|
# CHECK: MIPS RegInfo {
|
|
# CHECK-NEXT: GP: 0x408FF0
|
|
# CHECK-NEXT: General Mask: 0x66666666
|
|
# CHECK-NEXT: Co-Proc Mask0: 0x66666666
|
|
# CHECK-NEXT: Co-Proc Mask1: 0x66666666
|
|
# CHECK-NEXT: Co-Proc Mask2: 0x66666666
|
|
# CHECK-NEXT: Co-Proc Mask3: 0x66666666
|
|
# CHECK-NEXT: }
|
|
|
|
# t1.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Size: 4
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .reginfo
|
|
Type: SHT_MIPS_REGINFO
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 4
|
|
Content: "111111111111111111111111111111111111111100000000"
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T1
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 4
|
|
|
|
# t2.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Size: 4
|
|
AddressAlign: 16
|
|
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
|
|
|
|
- Name: .reginfo
|
|
Type: SHT_MIPS_REGINFO
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 4
|
|
Content: "222222222222222222222222222222222222222200000000"
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T2
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 4
|
|
|
|
# t3.o
|
|
---
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32R2]
|
|
|
|
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: .reginfo
|
|
Type: SHT_MIPS_REGINFO
|
|
Flags: [ SHF_ALLOC ]
|
|
AddressAlign: 4
|
|
Content: "444444444444444444444444444444444444444400000000"
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: T0
|
|
Section: .text
|
|
Type: STT_FUNC
|
|
Value: 0
|
|
Size: 4
|
|
- Name: T2
|
|
...
|