summaryrefslogtreecommitdiff
path: root/utils/sbtools/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/sbtools/elf.c')
-rw-r--r--utils/sbtools/elf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/sbtools/elf.c b/utils/sbtools/elf.c
index 896c9cb1c0..718cb58b05 100644
--- a/utils/sbtools/elf.c
+++ b/utils/sbtools/elf.c
@@ -19,6 +19,7 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "elf.h" 21#include "elf.h"
22#include "misc.h"
22 23
23/** 24/**
24 * Definitions 25 * Definitions
@@ -219,7 +220,8 @@ void elf_add_fill_section(struct elf_params_t *params,
219 sec->pattern = pattern; 220 sec->pattern = pattern;
220} 221}
221 222
222void elf_write_file(struct elf_params_t *params, elf_write_fn_t write, void *user) 223void elf_write_file(struct elf_params_t *params, elf_write_fn_t write,
224 elf_printf_fn_t printf, void *user)
223{ 225{
224 Elf32_Ehdr ehdr; 226 Elf32_Ehdr ehdr;
225 uint32_t phnum = 0; 227 uint32_t phnum = 0;
@@ -236,6 +238,10 @@ void elf_write_file(struct elf_params_t *params, elf_write_fn_t write, void *use
236 sec->offset = offset; 238 sec->offset = offset;
237 offset += sec->size; 239 offset += sec->size;
238 } 240 }
241 else
242 {
243 sec->offset = 0;
244 }
239 245
240 phnum++; 246 phnum++;
241 sec = sec->next; 247 sec = sec->next;