diff options
Diffstat (limited to 'elfinfo.cpp')
-rw-r--r-- | elfinfo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/elfinfo.cpp b/elfinfo.cpp index 6ddbceb..985a2de 100644 --- a/elfinfo.cpp +++ b/elfinfo.cpp @@ -192,10 +192,17 @@ int main(int argc, char **argv) { LdScript file = loader.load(ld_filename); memoryAreas.insert(memoryAreas.end(), file.memoryAreas.begin(), file.memoryAreas.end()); + } catch (LdParseException &e) { + for (auto &m: e.messages) { + fprintf(stderr, m.c_str()); + } + errx(EX_DATAERR, "Could not parse ld script"); } catch (std::exception &e) { - errx(EX_DATAERR, "Unhandled exception when parsing LD script. The parser is new and fragile, so please file a bug and send me your LD script: %s", e.what()); + errx(EX_DATAERR, "Unhandled exception when parsing LD script. " + "The parser is new and fragile, so please file a bug and send me your LD script: %s", e.what()); } catch (...) { - errx(EX_DATAERR, "Unhandled exception when parsing LD script. The parser is new and fragile, so please file a bug and send me your LD script."); + errx(EX_DATAERR, "Unhandled exception when parsing LD script. " + "The parser is new and fragile, so please file a bug and send me your LD script."); } } |