SECREL relocation's value is the offset to the beginning of the section. Because of the off-by-one error, if a SECREL relocation target is at the beginning of a section, it got wrong value. Added a test that would have caught this. llvm-svn: 221420
48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
---
|
|
header:
|
|
Machine: IMAGE_FILE_MACHINE_I386
|
|
Characteristics: [ ]
|
|
sections:
|
|
- Name: .data
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
|
|
Alignment: 4
|
|
SectionData: 00000000000000000000000000000000
|
|
Relocations:
|
|
- VirtualAddress: 0
|
|
SymbolName: .data
|
|
Type: IMAGE_REL_I386_SECREL
|
|
- Name: .data2
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
|
|
Alignment: 4
|
|
SectionData: 00000000000000000000000000000000
|
|
Relocations:
|
|
- VirtualAddress: 0
|
|
SymbolName: .data2
|
|
Type: IMAGE_REL_I386_SECREL
|
|
symbols:
|
|
- Name: .data
|
|
Value: 0
|
|
SectionNumber: 1
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
SectionDefinition:
|
|
Length: 4
|
|
NumberOfRelocations: 1
|
|
NumberOfLinenumbers: 0
|
|
CheckSum: 0
|
|
Number: 1
|
|
- Name: .data2
|
|
Value: 0
|
|
SectionNumber: 2
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
SectionDefinition:
|
|
Length: 4
|
|
NumberOfRelocations: 1
|
|
NumberOfLinenumbers: 0
|
|
CheckSum: 0
|
|
Number: 2
|
|
...
|