mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
MC/Mach-O: On second thought, use a custom hook for enabling aggressive
IsSymbolRefDifferenceFullyResolved, it turns out this does change behavior on enough cases for x86-32 that I would rather wait a bit on it. - In practice, we will want to change this eventually because it only means we generate less relocations (it also eliminates the need for the horrible '.set' hack that Darwin requires in some places). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122042 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -12,8 +12,10 @@
|
||||
using namespace llvm;
|
||||
|
||||
MCMachObjectTargetWriter::MCMachObjectTargetWriter(
|
||||
bool Is64Bit_, uint32_t CPUType_, uint32_t CPUSubtype_)
|
||||
: Is64Bit(Is64Bit_), CPUType(CPUType_), CPUSubtype(CPUSubtype_) {
|
||||
bool Is64Bit_, uint32_t CPUType_, uint32_t CPUSubtype_,
|
||||
bool UseAggressiveSymbolFolding_)
|
||||
: Is64Bit(Is64Bit_), CPUType(CPUType_), CPUSubtype(CPUSubtype_),
|
||||
UseAggressiveSymbolFolding(UseAggressiveSymbolFolding_) {
|
||||
}
|
||||
|
||||
MCMachObjectTargetWriter::~MCMachObjectTargetWriter() {
|
||||
|
@@ -1126,6 +1126,9 @@ public:
|
||||
bool IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm,
|
||||
const MCSymbolRefExpr *A,
|
||||
const MCSymbolRefExpr *B) const {
|
||||
if (!TargetObjectWriter->useAggressiveSymbolFolding())
|
||||
return false;
|
||||
|
||||
// The effective address is
|
||||
// addr(atom(A)) + offset(A)
|
||||
// - addr(atom(B)) - offset(B)
|
||||
|
Reference in New Issue
Block a user