mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
X86/Encoding: Support ExternalSymbol operands in emitDisplacementField (for consistency).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80727 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31e2c7b4c1
commit
4e8d5fe510
@ -337,6 +337,11 @@ void Emitter<CodeEmitter>::emitDisplacementField(const MachineOperand *RelocOp,
|
||||
bool Indirect = gvNeedsNonLazyPtr(*RelocOp, TM);
|
||||
emitGlobalAddress(RelocOp->getGlobal(), rt, RelocOp->getOffset(),
|
||||
Adj, NeedStub, Indirect);
|
||||
} else if (RelocOp->isSymbol()) {
|
||||
unsigned rt = Is64BitMode ?
|
||||
(IsPCRel ? X86::reloc_pcrel_word : X86::reloc_absolute_word_sext)
|
||||
: (IsPCRel ? X86::reloc_picrel_word : X86::reloc_absolute_word);
|
||||
emitExternalSymbolAddress(RelocOp->getSymbolName(), rt);
|
||||
} else if (RelocOp->isCPI()) {
|
||||
unsigned rt = Is64BitMode ?
|
||||
(IsPCRel ? X86::reloc_pcrel_word : X86::reloc_absolute_word_sext)
|
||||
@ -364,6 +369,8 @@ void Emitter<CodeEmitter>::emitMemModRMByte(const MachineInstr &MI,
|
||||
// Figure out what sort of displacement we have to handle here.
|
||||
if (Op3.isGlobal()) {
|
||||
DispForReloc = &Op3;
|
||||
} else if (Op3.isSymbol()) {
|
||||
DispForReloc = &Op3;
|
||||
} else if (Op3.isCPI()) {
|
||||
if (!MCE.earlyResolveAddresses() || Is64BitMode || IsPIC) {
|
||||
DispForReloc = &Op3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user