[COFF] Add support for IMAGE_REL_ARM_SECREL

Handle this in the exact same way as IMAGE_REL_AMD64_SECREL
and IMAGE_REL_I386_SECREL.

Differential revision: https://reviews.llvm.org/D24608

llvm-svn: 282531
This commit is contained in:
Martin Storsjo 2016-09-27 19:27:17 +00:00
parent 81eb5f6a60
commit 63762b58c0
2 changed files with 6 additions and 1 deletions

View File

@ -134,6 +134,7 @@ void SectionChunk::applyRelARM(uint8_t *Off, uint16_t Type, Defined *Sym,
case IMAGE_REL_ARM_BRANCH20T: applyBranch20T(Off, S - P - 4); break;
case IMAGE_REL_ARM_BRANCH24T: applyBranch24T(Off, S - P - 4); break;
case IMAGE_REL_ARM_BLX23T: applyBranch24T(Off, S - P - 4); break;
case IMAGE_REL_ARM_SECREL: add32(Off, Sym->getSecrel()); break;
default:
fatal("unsupported relocation type");
}

View File

@ -10,6 +10,7 @@
# CHECK: 402040 3e04de2f 00000000 00000000 00000000
# CHECK: 402050 fe07d62f 00000000 00000000 00000000
# CHECK: 402060 fef0cef7 00000000 00000000 00000000
# CHECK: 402070 00005000 00000000 00000000 00000000
--- !COFF
header:
@ -23,7 +24,7 @@ sections:
- Name: .text
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_PURGEABLE, IMAGE_SCN_MEM_16BIT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
Alignment: 4096
SectionData: 00000000000000000000000000000000000000000000000000000000000000004ff6ff79cff6ff79000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f000f8000000000000000000000000
SectionData: 00000000000000000000000000000000000000000000000000000000000000004ff6ff79cff6ff79000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f000f800000000000000000000000000000000000000000000000000000000
Relocations:
- VirtualAddress: 0
SymbolName: foo
@ -46,6 +47,9 @@ sections:
- VirtualAddress: 96
SymbolName: bar
Type: 20 # IMAGE_REL_ARM_BRANCH24T
- VirtualAddress: 112
SymbolName: bar
Type: 15 # IMAGE_REL_ARM_SECREL
symbols:
- Name: .aaa
Value: 0