/// handle a weak_definition of constant 0 for an omitted EH frame.
bool SupportsWeakOmittedEHFrame; // Defaults to true.
+ /// ShortenEHDataON64Bit - True if target exception table format requires
+ /// 32-bit data in certain places even when targeting 64-bits.
+ bool ShortenEHDataOn64Bit; // Defaults to false.
+
/// DwarfSectionOffsetDirective - Special section offset directive.
const char* DwarfSectionOffsetDirective; // Defaults to NULL
bool getSupportsWeakOmittedEHFrame() const {
return SupportsWeakOmittedEHFrame;
}
+ bool getShortenEHDataOn64Bit() const {
+ return ShortenEHDataOn64Bit;
+ }
const char *getDwarfSectionOffsetDirective() const {
return DwarfSectionOffsetDirective;
}
Asm->EOL("Personality (pcrel sdata4 indirect)");
- PrintRelDirective();
+ PrintRelDirective(TAI->getShortenEHDataOn64Bit());
O << TAI->getPersonalityPrefix();
Asm->EmitExternalGlobal((const GlobalVariable *)(Personality));
O << TAI->getPersonalitySuffix();
- O << "-" << TAI->getPCSymbol();
+ if (!TAI->getShortenEHDataOn64Bit()) {
+ O << "-" << TAI->getPCSymbol();
+ }
Asm->EOL("Personality");
Asm->EmitULEB128Bytes(DW_EH_PE_pcrel);
// If there is a personality and landing pads then point to the language
// specific data area in the exception table.
if (EHFrameInfo.PersonalityIndex) {
- Asm->EmitULEB128Bytes(4);
+ Asm->EmitULEB128Bytes(TAI->getShortenEHDataOn64Bit() ? 8 : 4);
Asm->EOL("Augmentation size");
if (EHFrameInfo.hasLandingPads) {
}
EmitSectionOffset(BeginTag, "eh_func_begin", BeginNumber, SubprogramCount,
- false, true);
+ TAI->getShortenEHDataOn64Bit(), true);
Asm->EOL("Region start");
if (!S.EndLabel) {
- EmitDifference("eh_func_end", SubprogramCount, BeginTag, BeginNumber);
+ EmitDifference("eh_func_end", SubprogramCount, BeginTag, BeginNumber,
+ TAI->getShortenEHDataOn64Bit());
} else {
- EmitDifference("label", S.EndLabel, BeginTag, BeginNumber);
+ EmitDifference("label", S.EndLabel, BeginTag, BeginNumber,
+ TAI->getShortenEHDataOn64Bit());
}
Asm->EOL("Region length");
if (!S.PadLabel) {
- if (TD->getPointerSize() == sizeof(int32_t))
+ if (TD->getPointerSize() == sizeof(int32_t) || TAI->getShortenEHDataOn64Bit())
Asm->EmitInt32(0);
else
Asm->EmitInt64(0);
} else {
EmitSectionOffset("label", "eh_func_begin", S.PadLabel, SubprogramCount,
- false, true);
+ TAI->getShortenEHDataOn64Bit(), true);
}
Asm->EOL("Landing pad");
StaticCtorsSection = ".mod_init_func";
StaticDtorsSection = ".mod_term_func";
}
+ SwitchToSectionDirective = "\t.section ";
UsedDirective = "\t.no_dead_strip\t";
WeakDefDirective = "\t.weak_definition ";
WeakRefDirective = "\t.weak_reference ";
O << "\n";
- if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI) {
+ if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI &&
+ !Subtarget->is64Bit()) {
// Add the (possibly multiple) personalities to the set of global values.
const std::vector<Function *>& Personalities = MMI->getPersonalities();
SixteenByteConstantSection = "\t.literal16\n";
ReadOnlySection = "\t.const\n";
LCOMMDirective = "\t.lcomm\t";
+ SwitchToSectionDirective = "\t.section ";
COMMDirectiveTakesAlignment = false;
HasDotTypeDotSizeDirective = false;
if (TM.getRelocationModel() == Reloc::Static) {
StaticCtorsSection = ".mod_init_func";
StaticDtorsSection = ".mod_term_func";
}
- PersonalityPrefix = "L";
- PersonalitySuffix = "$non_lazy_ptr";
+ if (Subtarget->is64Bit()) {
+ PersonalityPrefix = "";
+ PersonalitySuffix = "+4@GOTPCREL";
+ } else {
+ PersonalityPrefix = "L";
+ PersonalitySuffix = "$non_lazy_ptr";
+ }
NeedsIndirectEncoding = true;
InlineAsmStart = "# InlineAsm Start";
InlineAsmEnd = "# InlineAsm End";
DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
// Exceptions handling
- if (!Subtarget->is64Bit())
- SupportsExceptionHandling = true;
+ SupportsExceptionHandling = true;
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
AbsoluteEHSectionOffsets = false;
+ if (Subtarget->is64Bit())
+ ShortenEHDataOn64Bit = true;
DwarfEHFrameSection =
".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
DwarfExceptionSection = ".section __DATA,__gcc_except_tab";