aboutsummaryrefslogtreecommitdiff
path: root/elfinfo.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-07-17 16:03:47 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-07-17 16:03:47 +0200
commit0f57cc9750282ce0284fe69b06f161dea2bfc8cb (patch)
tree50afd51fec2d05752cc49441ae47c40aa831cf84 /elfinfo.cpp
parentc5e53ec8da9b11e351893742096f76e2bceb5730 (diff)
downloadelfinfo-0f57cc9750282ce0284fe69b06f161dea2bfc8cb.tar.gz
elfinfo-0f57cc9750282ce0284fe69b06f161dea2bfc8cb.tar.bz2
elfinfo-0f57cc9750282ce0284fe69b06f161dea2bfc8cb.tar.xz
elfinfo-0f57cc9750282ce0284fe69b06f161dea2bfc8cb.zip
parser/lexer:
o Support special '/DISCARD/' as NAME. o Add 'SORT' as a token. It is equivalent with SORT_BY_NAME. The new rule sort_by_name coverts both. Ld: o Don't die on unknown sections, they can be referenced before declared. Doesn't matter for this app anyway.
Diffstat (limited to 'elfinfo.cpp')
-rw-r--r--elfinfo.cpp11
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.");
}
}