ld: add function to dump loaded image list
This commit is contained in:
@@ -184,6 +184,30 @@ static int link_images(const char *task_name, struct image_list *list)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static int dump_loaded_images(struct image_list *list)
|
||||
{
|
||||
int status = SUCCESS;
|
||||
struct image_list_iterator it;
|
||||
image_list_iterator_begin(&it, list);
|
||||
|
||||
kern_log("------------");
|
||||
kern_log("loaded images:");
|
||||
while (it.it_leaf) {
|
||||
struct elf_image *image
|
||||
= QUEUE_CONTAINER(struct elf_image, e_leaf, it.it_leaf);
|
||||
kern_logf(
|
||||
"%s [%zx-%zx]",
|
||||
it.it_leaf->l_name,
|
||||
image->e_base,
|
||||
image->e_base + image->e_length);
|
||||
|
||||
image_list_iterator_move_next(&it);
|
||||
}
|
||||
kern_logf("------------");
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
int main(const struct rosetta_bootstrap *bs)
|
||||
{
|
||||
kern_tracef("ld");
|
||||
@@ -241,6 +265,7 @@ int main(const struct rosetta_bootstrap *bs)
|
||||
image_list_iterator_move_next(&it);
|
||||
}
|
||||
|
||||
dump_loaded_images(&images);
|
||||
kern_tracef("ld finished");
|
||||
struct rosetta_bootstrap exec_bsinfo;
|
||||
memcpy(&exec_bsinfo, bs, sizeof exec_bsinfo);
|
||||
|
||||
Reference in New Issue
Block a user