@@ -106,7 +106,10 @@ const std::vector<std::string> cRelSectionMask = {
106
106
int main (int argc, char **argv)
107
107
{
108
108
if (argc <= 2 )
109
+ {
110
+ printf (" Usage: %s <elf file> <symbol file>" , argv[0 ]);
109
111
return 1 ;
112
+ }
110
113
111
114
std::string elfFilename = argv[1 ];
112
115
std::string lstFilename = argv[2 ];
@@ -115,14 +118,14 @@ int main(int argc, char **argv)
115
118
ELFIO::elfio inputElf;
116
119
if (!inputElf.load (elfFilename))
117
120
{
121
+ printf (" Failed to load input file" );
118
122
return 1 ;
119
123
}
120
124
121
125
auto externalSymbolMap = loadSymbolMap (lstFilename);
122
126
123
127
// Find special sections
124
128
ELFIO::section *symSection = nullptr ;
125
- ELFIO::section *strSection = nullptr ;
126
129
std::vector<ELFIO::section *> relocationSections;
127
130
for (const auto §ion : inputElf.sections )
128
131
{
@@ -280,8 +283,8 @@ int main(int argc, char **argv)
280
283
if (!symbols.get_symbol (symbol, symbolName, symbolValue,
281
284
size, bind, symbolType, sectionIndex, other))
282
285
{
283
- // #todo-elf2rel: Proper error handling
284
- return - 1 ;
286
+ printf ( " Unable to find symbol %u in symbol table! " , static_cast < uint32_t >(symbol));
287
+ return 1 ;
285
288
}
286
289
287
290
// Add relocation to list
0 commit comments