• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/tools/arm_boot/

Lines Matching defs:image

5  * the CPU driver into kernel virtual.  It also constructs a multiboot image,
133 * information about the loaded image. */
135 load(int in_fd, uint32_t vp_offset, struct loaded_image *image,
169 image->shstrtab_size= shstrshdr->sh_size;
170 image->shstrtab= malloc(image->shstrtab_size);
171 if(!image->shstrtab) fail_errno("malloc");
172 memcpy(image->shstrtab, shstr, image->shstrtab_size);
180 image->shdrs_size= sh_totalsize;
181 image->shdrs_entsize= ehdr->e_shentsize;
182 image->shdrs= malloc(sh_totalsize);
183 if(!image->shdrs) fail_errno("malloc");
184 memcpy(image->shdrs, elfdata + ehdr->e_shoff, sh_totalsize);
210 if(image->symtab) fail("Found two symbol tables.\n");
212 image->symtab_size= shdr->sh_size;
213 image->symtab_entsize= shdr->sh_entsize;
214 image->symtab= malloc(shdr->sh_size);
215 if(!image->symtab) fail_errno("malloc");
218 memcpy(image->symtab, elfdata + shdr->sh_offset,
226 if(image->strtab) fail("Found two string tables.\n");
228 image->strtab_size= shdr->sh_size;
229 image->strtab= malloc(shdr->sh_size);
230 if(!image->strtab) fail_errno("malloc");
233 memcpy(image->strtab, elfdata + shdr->sh_offset,
283 if(image->extrasym_name &&
284 !strcmp(image->extrasym_name, str_base + sym->st_name)) {
285 DBG("Found %s at %08x\n", image->extrasym_name,
292 if(image->extrasym_name && !found_extrasym)
293 fail("No %s symbol\n", image->extrasym_name);
305 image->segment_base= phdr->p_vaddr;
306 image->segment_size= phdr->p_memsz;
328 image->loaded_size= round_up(phdr->p_memsz, BASE_PAGE_SIZE);
329 image->loaded_paddr= phys_alloc(image->loaded_size, seg_align);
330 image->loaded_vaddr= image->loaded_paddr + vp_offset;
332 image->loaded_size,
333 image->loaded_vaddr,
334 image->loaded_paddr, sidx);
340 image->loaded_vaddr + (got_base - phdr->p_vaddr);
350 image->relocated_entry=
351 image->loaded_vaddr + (entry - phdr->p_vaddr);
353 sidx, image->relocated_entry);
358 loaded_segment= calloc(image->loaded_size, 1);
360 image->segment= loaded_segment;
374 if(image->extrasym_name &&
379 image->extrasym_name, sidx, extrasym_offset);
380 /* Return the address within the loaded image. */
381 image->extrasym_ptr= loaded_segment + extrasym_offset;
387 if(image->extrasym_name && !found_extrasym)
388 fail("%s not in any loadable segment.\n", image->extrasym_name);
419 uint32_t reloc_offset= image->loaded_vaddr - phdr->p_vaddr;
438 return image->segment;
503 /* Add an image (module or multiboot header) in its own section. */
505 add_blob(Elf *elf, const char *name, void *image, size_t size,
511 /* Add the image as a new data blob. */
516 data->d_buf= image;
541 /* Add a loaded image as a blob, without individual section headers. */
543 add_image(Elf *elf, const char *name, struct loaded_image *image) {
544 return add_blob(elf, name, image->segment, image->loaded_size,
545 image->loaded_paddr);
599 /* Add a loaded image by including all its loadable sections, and its symbol
602 add_image_with_sections(Elf *elf, struct loaded_image *image) {
605 assert(image->shdrs);
606 assert(image->shstrtab);
608 size_t nshdr= image->shdrs_size / image->shdrs_entsize;
620 Elf32_Shdr *shdr= image->shdrs + i * image->shdrs_entsize;
627 if(shdr->sh_addr < image->segment_base ||
628 shdr->sh_addr >= image->segment_base + image->segment_size) {
634 image->segment_base + image->segment_size);
636 const char *name= image->shstrtab + shdr->sh_name;
648 uint32_t offset_in_seg= shdr->sh_addr - image->segment_base;
649 void *section_data= image->segment + offset_in_seg;
676 new_shdr->sh_addr= image->loaded_vaddr + offset_in_seg;
692 paddr_t paddr= image->loaded_paddr + offset_in_seg;
709 uint32_t offset_in_seg= shdr->sh_addr - image->loaded_vaddr;
710 void *section_data= image->segment + offset_in_seg;
715 shdr->sh_entsize, image->segment_base,
716 image->loaded_vaddr, new_index, nshdr);
721 update_table(SHT_SYMTAB, image->symtab, image->symtab_size,
722 image->symtab_entsize, image->segment_base,
723 image->loaded_vaddr, new_index, nshdr);
728 /* Add the non-loadable tables from an image. This is separated from
732 add_tables(Elf *elf, struct loaded_image *image) {
733 /* Add the string table for the loaded image. */
736 assert(image->strtab);
749 data->d_buf= image->strtab;
751 data->d_size= image->strtab_size;
761 shdr->sh_offset= increase_elf_offset(image->strtab_size);
762 shdr->sh_size= image->strtab_size;
769 assert(image->symtab);
779 data->d_buf= image->symtab;
781 data->d_size= image->symtab_size;
796 shdr->sh_offset= increase_elf_offset(image->symtab_size);
797 shdr->sh_size= image->symtab_size;
799 shdr->sh_entsize= image->symtab_entsize;
1114 * multiboot image. Pass the CPU driver entry point. */
1126 /* Open the output image file. */
1162 /* The boot driver, CPU driver and multiboot image all get their own
1202 /* This is dodgy, but GEM5 refuses to load an image that doesn't have a