mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
Output a CSV file with the required libraries
This commit makes `revamb` produce a new file `.ll.need.csv` containing a list of all the dynamic libraries required by the input program. This will be transformed by the 'csv-to-ld-options` (was: `li-csv-to-ld-options`) into the appropriate linking options.
This commit is contained in:
+7
-2
@@ -110,7 +110,7 @@ CodeGenerator::CodeGenerator(BinaryFile &Binary,
|
||||
if (LinkingInfo.size() == 0)
|
||||
LinkingInfo = OutputPath + ".li.csv";
|
||||
std::ofstream LinkingInfoStream(LinkingInfo);
|
||||
LinkingInfoStream << "name,start,end" << std::endl;
|
||||
LinkingInfoStream << "name,start,end\n";
|
||||
|
||||
auto *Uint8Ty = Type::getInt8Ty(Context);
|
||||
auto *ElfHeaderHelper = new GlobalVariable(*TheModule,
|
||||
@@ -187,10 +187,15 @@ CodeGenerator::CodeGenerator(BinaryFile &Binary,
|
||||
LinkingInfoStream << "." << Name
|
||||
<< ",0x" << std::hex << Segment.StartVirtualAddress
|
||||
<< ",0x" << std::hex << Segment.EndVirtualAddress
|
||||
<< std::endl;
|
||||
<< "\n";
|
||||
|
||||
}
|
||||
|
||||
// Write needed libraries CSV
|
||||
std::string NeededLibs = OutputPath + ".need.csv";
|
||||
std::ofstream NeededLibsStream(NeededLibs);
|
||||
for (const std::string &Library : Binary.neededLibraryNames())
|
||||
NeededLibsStream << Library << "\n";
|
||||
}
|
||||
|
||||
Function *CodeGenerator::importHelperFunctionDefinition(StringRef Name) {
|
||||
|
||||
Reference in New Issue
Block a user