/// Read info from special sections. E.g. eh_frame and .gcc_except_table
/// for exception and stack unwinding information.
- void readSpecialSections();
+ Error readSpecialSections();
/// Adjust supplied command-line options based on input data.
void adjustCommandLineOptions();
if (Error E = discoverStorage())
return E;
- readSpecialSections();
+ if (Error E = readSpecialSections())
+ return E;
adjustCommandLineOptions();
discoverFileObjects();
uint64_t RewriteInstance::getLSDAAddress() { return LSDASection->getAddress(); }
-void RewriteInstance::readSpecialSections() {
+Error RewriteInstance::readSpecialSections() {
NamedRegionTimer T("readSpecialSections", "read special sections",
TimerGroupName, TimerGroupDesc, opts::TimeRewrite);
// Only register sections with names.
if (!SectionName.empty()) {
+ if (Error E = Section.getContents().takeError())
+ return E;
BC->registerSection(Section);
LLVM_DEBUG(
dbgs() << "BOLT-DEBUG: registering section " << SectionName << " @ 0x"
// Read .dynamic/PT_DYNAMIC.
readELFDynamic();
+ return Error::success();
}
void RewriteInstance::adjustCommandLineOptions() {