本文整理汇总了C++中LDSection::flag方法的典型用法代码示例。如果您正苦于以下问题:C++ LDSection::flag方法的具体用法?C++ LDSection::flag怎么用?C++ LDSection::flag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LDSection
的用法示例。
在下文中一共展示了LDSection::flag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSection
bool ARMGNULDBackend::readSection(Input& pInput,
MCLinker& pLinker,
LDSection& pInputSectHdr)
{
LDSection& out_sect = pLinker.getOrCreateOutputSectHdr(pInputSectHdr.name(),
pInputSectHdr.kind(),
pInputSectHdr.type(),
pInputSectHdr.flag());
// FIXME: (Luba)
// Handle ARM attributes in the right way.
// In current milestone, MCLinker goes through the shortcut.
// It reads input's ARM attributes and copies the first ARM attributes
// into the output file. The correct way is merge these sections, not
// just copy.
if ((0 == out_sect.name().compare(".ARM.attributes")) &&
(0 != out_sect.size()))
return true;
MemoryRegion* region = pInput.memArea()->request(pInputSectHdr.offset(),
pInputSectHdr.size());
llvm::MCSectionData& sect_data = pLinker.getOrCreateSectData(pInputSectHdr);
new MCRegionFragment(*region, §_data);
out_sect.setSize(out_sect.size() + pInputSectHdr.size());
return true;
}
示例2: mergeSection
/// merge Input Sections
bool HexagonLDBackend::mergeSection(Module& pModule,
const Input& pInputFile,
LDSection& pInputSection) {
if ((pInputSection.flag() & llvm::ELF::SHF_HEX_GPREL) ||
(pInputSection.kind() == LDFileFormat::LinkOnce) ||
(pInputSection.kind() == LDFileFormat::Target)) {
SectionData* sd = NULL;
if (!m_psdata->hasSectionData()) {
sd = IRBuilder::CreateSectionData(*m_psdata);
m_psdata->setSectionData(sd);
}
sd = m_psdata->getSectionData();
MoveSectionDataAndSort(*pInputSection.getSectionData(), *sd);
} else {
ObjectBuilder builder(pModule);
builder.MergeSection(pInputFile, pInputSection);
}
return true;
}