Skip to content

Commit

Permalink
rimage: split man_module_create_reloc()
Browse files Browse the repository at this point in the history
The second preparatory step for multi-part relocatable module
libraries.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh authored and lgirdwood committed Dec 6, 2024
1 parent a371c3c commit 0e29ea3
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions tools/rimage/src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,23 +457,12 @@ static int man_module_create(struct image *image, struct manifest_module *module
return 0;
}

static int man_module_create_reloc(struct image *image, struct manifest_module *module,
struct sof_man_module *man_module)
static void man_module_fill_reloc(const struct manifest_module *module,
struct sof_man_module *man_module)
{
/* create module and segments */
int err;

image->image_end = 0;

err = man_get_module_manifest(image, module, man_module);
if (err < 0)
return err;

/* stack size ??? convert sizes to PAGES */
man_module->instance_bss_size = 1;

module_print_zones(&module->file);

/* main module */
/* text section is first */
man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset =
Expand All @@ -491,6 +480,23 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *
man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0;
man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = 0;
man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = 0;
}

static int man_module_create_reloc(struct image *image, struct manifest_module *module,
struct sof_man_module *man_module)
{
/* create module and segments */
int err;

image->image_end = 0;

err = man_get_module_manifest(image, module, man_module);
if (err < 0)
return err;

module_print_zones(&module->file);

man_module_fill_reloc(module, man_module);

fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n");

Expand Down

0 comments on commit 0e29ea3

Please sign in to comment.