summaryrefslogtreecommitdiff
path: root/util/cbfstool/rmodule.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-10-28 11:39:34 -0500
committerAaron Durbin <adurbin@chromium.org>2015-10-29 17:01:03 +0100
commit694fd133905ba6c87b2cef59b841660d1d82aeaa (patch)
tree754b2fb64a6502d398cb49d0c1149273caa6f40b /util/cbfstool/rmodule.h
parentcedcb882c1f0a2b9b61ffed9a646744d3e481e60 (diff)
cbfstool: extract rmodules as ELFs properly
With the previous ELF stage extract support the resulting ELF files wouldn't handle rmodules correctly in that the rmodule header as well as the relocations were a part of the program proper. Instead, try an initial pass at converting the stage as if it was an rmodule first. If it doesn't work fall back on the normal ELF extraction. TEST=Pulled an rmodule out of Chrome OS shellball. Manually matched up the metadata and relocations. Change-Id: Iaf222f92d145116ca4dfaa955fb7278e583161f2 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/12222 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'util/cbfstool/rmodule.h')
-rw-r--r--util/cbfstool/rmodule.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/cbfstool/rmodule.h b/util/cbfstool/rmodule.h
index 9a65677418..fa717659a1 100644
--- a/util/cbfstool/rmodule.h
+++ b/util/cbfstool/rmodule.h
@@ -88,4 +88,11 @@ int rmodule_collect_relocations(struct rmod_context *c, struct reloc_filter *f);
/* Clean up the memory consumed by the rmdoule context. */
void rmodule_cleanup(struct rmod_context *ctx);
+/*
+ * Create an ELF file from the passed in rmodule in the buffer. The buffer
+ * contents will be replaced with an ELF file. Returns 1 if buff doesn't
+ * contain an rmodule and < 0 on failure, 0 on success.
+ */
+int rmodule_stage_to_elf(Elf64_Ehdr *ehdr, struct buffer *buff);
+
#endif /* TOOL_RMODULE_H */