forked from OSchip/llvm-project
parent
39893bd41c
commit
9768d73c74
|
@ -371,7 +371,7 @@ protected:
|
|||
|
||||
// If true, emit GOTPCRELX/REX_GOTPCRELX instead of GOTPCREL, on
|
||||
// X86_64 ELF.
|
||||
bool RelaxELFRelocations;
|
||||
bool RelaxELFRelocations = false;
|
||||
|
||||
public:
|
||||
explicit MCAsmInfo();
|
||||
|
@ -582,6 +582,7 @@ public:
|
|||
bool shouldUseLogicalShr() const { return UseLogicalShr; }
|
||||
|
||||
bool canRelaxRelocations() const { return RelaxELFRelocations; }
|
||||
void setRelaxELFRelocations(bool V) { RelaxELFRelocations = V; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -34,10 +34,6 @@ AsmWriterFlavor("x86-asm-syntax", cl::init(ATT),
|
|||
clEnumValN(Intel, "intel", "Emit Intel-style assembly"),
|
||||
clEnumValEnd));
|
||||
|
||||
static cl::opt<bool>
|
||||
RelaxELFRel("relax-relocations", cl::init(false),
|
||||
cl::desc("Emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL"));
|
||||
|
||||
static cl::opt<bool>
|
||||
MarkedJTDataRegions("mark-data-regions", cl::init(true),
|
||||
cl::desc("Mark code section jump table data regions."),
|
||||
|
@ -115,8 +111,6 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
|
|||
// Always enable the integrated assembler by default.
|
||||
// Clang also enabled it when the OS is Solaris but that is redundant here.
|
||||
UseIntegratedAssembler = true;
|
||||
|
||||
RelaxELFRelocations = RelaxELFRel;
|
||||
}
|
||||
|
||||
const MCExpr *
|
||||
|
|
|
@ -52,6 +52,10 @@ OutputFilename("o", cl::desc("Output filename"),
|
|||
static cl::opt<bool>
|
||||
ShowEncoding("show-encoding", cl::desc("Show instruction encodings"));
|
||||
|
||||
static cl::opt<bool>
|
||||
RelaxELFRel("relax-relocations", cl::init(false),
|
||||
cl::desc("Emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL"));
|
||||
|
||||
static cl::opt<DebugCompressionType>
|
||||
CompressDebugSections("compress-debug-sections", cl::ValueOptional,
|
||||
cl::init(DebugCompressionType::DCT_None),
|
||||
|
@ -416,6 +420,8 @@ int main(int argc, char **argv) {
|
|||
std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TripleName));
|
||||
assert(MAI && "Unable to create target asm info!");
|
||||
|
||||
MAI->setRelaxELFRelocations(RelaxELFRel);
|
||||
|
||||
if (CompressDebugSections != DebugCompressionType::DCT_None) {
|
||||
if (!zlib::isAvailable()) {
|
||||
errs() << ProgName
|
||||
|
|
Loading…
Reference in New Issue