mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue method. This also make getExprForFDESymbol on ELF equal to the one on MachO, and it can be made non-virtual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130634 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1476,13 +1476,17 @@ unsigned X86ELFObjectWriter::GetRelocType(const MCValue &Target,
|
||||
if (IsPCRel) {
|
||||
switch ((unsigned)Fixup.getKind()) {
|
||||
default: llvm_unreachable("invalid fixup kind!");
|
||||
|
||||
case FK_Data_8: Type = ELF::R_X86_64_PC64; break;
|
||||
case FK_Data_4: Type = ELF::R_X86_64_PC32; break;
|
||||
case FK_Data_2: Type = ELF::R_X86_64_PC16; break;
|
||||
|
||||
case FK_PCRel_8:
|
||||
assert(Modifier == MCSymbolRefExpr::VK_None);
|
||||
Type = ELF::R_X86_64_PC64;
|
||||
break;
|
||||
case X86::reloc_signed_4byte:
|
||||
case X86::reloc_riprel_4byte_movq_load:
|
||||
case FK_Data_4: // FIXME?
|
||||
case X86::reloc_riprel_4byte:
|
||||
case FK_PCRel_4:
|
||||
switch (Modifier) {
|
||||
|
Reference in New Issue
Block a user