Changeset View
Changeset View
Standalone View
Standalone View
lib/MC/MCObjectFileInfo.cpp
Context not available. | |||||
} | } | ||||
void MCObjectFileInfo::initELFMCObjectFileInfo(Triple T) { | void MCObjectFileInfo::initELFMCObjectFileInfo(Triple T) { | ||||
bool eh_frame_writable = false; | |||||
switch (T.getArch()) { | switch (T.getArch()) { | ||||
case Triple::mips: | case Triple::mips: | ||||
case Triple::mipsel: | case Triple::mipsel: | ||||
Context not available. | |||||
dwarf::DW_EH_PE_sdata4; | dwarf::DW_EH_PE_sdata4; | ||||
// We don't support PC-relative LSDA references in GAS so we use the default | // We don't support PC-relative LSDA references in GAS so we use the default | ||||
// DW_EH_PE_absptr for those. | // DW_EH_PE_absptr for those. | ||||
// The section .eh_frame exhibits absolute addresses which require fixups. | |||||
// While the gnu linker can transform them in relative references at | |||||
// linking time, at the moment the mclinker does not provide this | |||||
// functionality. Setting the section as writable allows the fixups to be | |||||
// resolved at run time. | |||||
if (RelocM == Reloc::PIC_) { | |||||
eh_frame_writable = true; | |||||
} | |||||
break; | break; | ||||
case Triple::ppc64: | case Triple::ppc64: | ||||
case Triple::ppc64le: | case Triple::ppc64le: | ||||
Context not available. | |||||
else | else | ||||
EHSectionFlags |= ELF::SHF_WRITE; | EHSectionFlags |= ELF::SHF_WRITE; | ||||
} | } | ||||
if (eh_frame_writable) { | |||||
EHSectionFlags |= ELF::SHF_WRITE; | |||||
} | |||||
// ELF | // ELF | ||||
BSSSection = Ctx->getELFSection(".bss", ELF::SHT_NOBITS, | BSSSection = Ctx->getELFSection(".bss", ELF::SHT_NOBITS, | ||||
Context not available. |