forked from OSchip/llvm-project
62 lines
1.5 KiB
Plaintext
62 lines
1.5 KiB
Plaintext
# Check handling of R_MIPS_64 relocation.
|
|
|
|
# RUN: yaml2obj -format=elf %s > %t.o
|
|
# RUN: lld -flavor gnu -target mips64el -o %t.exe %t.o
|
|
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
|
|
|
|
# CHECK: Contents of section .data:
|
|
# CHECK-NEXT: 120002000 d1010020 01000000 d0010020 01000100 ... ....... ....
|
|
# ^^ __start + 1 = 0x1200001d1
|
|
# ^^ __start + 0x1000000000000
|
|
# = 0x10001200001d0
|
|
# CHECK: SYMBOL TABLE:
|
|
# CHECK: 00000001200001d0 g .rodata 00000008 __start
|
|
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64]
|
|
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Size: 0x08
|
|
AddressAlign: 16
|
|
Flags: [SHF_ALLOC]
|
|
- Name: .data
|
|
Type: SHT_PROGBITS
|
|
Size: 0x10
|
|
AddressAlign: 16
|
|
Flags: [SHF_ALLOC, SHF_WRITE]
|
|
|
|
- Name: .rela.data
|
|
Type: SHT_RELA
|
|
Info: .data
|
|
AddressAlign: 4
|
|
Relocations:
|
|
- Offset: 0x0
|
|
Symbol: __start
|
|
Type: R_MIPS_64
|
|
Addend: 1
|
|
- Offset: 0x8
|
|
Symbol: __start
|
|
Type: R_MIPS_64
|
|
Addend: 0x1000000000000
|
|
|
|
Symbols:
|
|
Global:
|
|
- Name: __start
|
|
Section: .text
|
|
Value: 0x0
|
|
Size: 8
|
|
- Name: data1
|
|
Section: .data
|
|
Value: 0x0
|
|
Size: 8
|
|
- Name: data2
|
|
Section: .data
|
|
Value: 0x8
|
|
Size: 8
|