forked from OSchip/llvm-project
[COFF] Minor tweaks to ARM64 relocation code. NFC.
Fix issues found in existing code, while reviewing other changes. Change the data type of a variable to uint32_t, to avoid potential issues with signedness in shifts. Differential revision: https://reviews.llvm.org/D35646 llvm-svn: 308586
This commit is contained in:
parent
b3c97b9623
commit
dd62dffbcb
|
@ -183,11 +183,10 @@ static void applyArm64Imm(uint8_t *Off, uint64_t Imm) {
|
|||
}
|
||||
|
||||
static void applyArm64Ldr(uint8_t *Off, uint64_t Imm) {
|
||||
int Size = read32le(Off) >> 30;
|
||||
uint32_t Size = read32le(Off) >> 30;
|
||||
if ((Imm & ((1 << Size) - 1)) != 0)
|
||||
fatal("misaligned ldr/str offset");
|
||||
Imm >>= Size;
|
||||
applyArm64Imm(Off, Imm);
|
||||
applyArm64Imm(Off, Imm >> Size);
|
||||
}
|
||||
|
||||
void SectionChunk::applyRelARM64(uint8_t *Off, uint16_t Type, OutputSection *OS,
|
||||
|
|
Loading…
Reference in New Issue