summaryrefslogtreecommitdiff
path: root/util/cbfstool/rmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/rmodule.c')
-rw-r--r--util/cbfstool/rmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/cbfstool/rmodule.c b/util/cbfstool/rmodule.c
index 258a4d8803..4ac2951f72 100644
--- a/util/cbfstool/rmodule.c
+++ b/util/cbfstool/rmodule.c
@@ -498,8 +498,9 @@ write_elf(const struct rmod_context *ctx, const struct buffer *in,
/* Program contents. */
buffer_splice(&program, in, ctx->phdr->p_offset, ctx->phdr->p_filesz);
- /* Create ELF writer with modified entry point. */
+ /* Create ELF writer. Set entry point to 0 to match section offsets. */
memcpy(&ehdr, &ctx->pelf.ehdr, sizeof(ehdr));
+ ehdr.e_entry = 0;
ew = elf_writer_init(&ehdr);
if (ew == NULL) {