clean up rel helpers

This commit is contained in:
Martin Michelsen
2026-05-08 22:22:41 -07:00
parent e342915505
commit 9915422ae6
3 changed files with 46 additions and 37 deletions
+13
View File
@@ -23,6 +23,7 @@
#include "AddressTranslator.hh"
#include "BMLArchive.hh"
#include "CommonFileFormats.hh"
#include "Compression.hh"
#include "DCSerialNumbers.hh"
#include "DNSServer.hh"
@@ -2428,6 +2429,18 @@ Action a_encode_item_parameter_table(
write_output_data(args, data.data(), data.size(), nullptr);
});
Action a_find_rel_sectionr(
"find-rel-sections", nullptr,
+[](phosg::Arguments& args) {
auto data = read_input_data(args);
auto offsets = args.get<bool>("big-endian")
? all_relocation_offsets_for_rel_file<true>(data.data(), data.size())
: all_relocation_offsets_for_rel_file<false>(data.data(), data.size());
for (uint32_t offset : offsets) {
phosg::fwrite_fmt(stdout, "{:08X}\n", offset);
}
});
Action a_describe_item(
"describe-item", "\
describe-item DATA-OR-DESCRIPTION\n\