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>
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user