Lines Matching refs:dl
188 GetMopFileInfo(struct dllist *dl) in GetMopFileInfo() argument
194 if (read(dl->ldfd, header, 512) != 512) in GetMopFileInfo()
291 dl->image_type = IMAGE_TYPE_MOP; in GetMopFileInfo()
292 dl->loadaddr = load_addr; in GetMopFileInfo()
293 dl->xferaddr = xfr_addr; in GetMopFileInfo()
452 GetElfFileInfo(struct dllist *dl) in GetElfFileInfo() argument
463 (void)lseek(dl->ldfd, (off_t) 0, SEEK_SET); in GetElfFileInfo()
465 if (read(dl->ldfd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr)) in GetElfFileInfo()
523 dl->image_type = IMAGE_TYPE_ELF32; in GetElfFileInfo()
524 dl->loadaddr = 0; in GetElfFileInfo()
525 dl->xferaddr = e_entry; /* will relocate itself if necessary */ in GetElfFileInfo()
529 dl->e_nsec = e_phnum; in GetElfFileInfo()
530 for (i = 0; i < dl->e_nsec; i++) { in GetElfFileInfo()
531 if (lseek(dl->ldfd, (off_t) e_phoff + (i * e_phentsize), in GetElfFileInfo()
534 if (read(dl->ldfd, (char *) &phdr, sizeof(phdr)) != in GetElfFileInfo()
540 dl->e_sections[i].s_foff = in GetElfFileInfo()
544 dl->e_sections[i].s_vaddr = in GetElfFileInfo()
548 dl->e_sections[i].s_fsize = in GetElfFileInfo()
552 dl->e_sections[i].s_msize = in GetElfFileInfo()
559 dl->e_sections[i].s_foff = in GetElfFileInfo()
563 dl->e_sections[i].s_vaddr = in GetElfFileInfo()
567 dl->e_sections[i].s_fsize = in GetElfFileInfo()
571 dl->e_sections[i].s_msize = in GetElfFileInfo()
585 for (i = 0; i < dl->e_nsec - 1; i++) { in GetElfFileInfo()
586 dl->e_sections[i].s_pad = in GetElfFileInfo()
587 dl->e_sections[i + 1].s_vaddr - in GetElfFileInfo()
588 (dl->e_sections[i].s_vaddr + dl->e_sections[i].s_fsize); in GetElfFileInfo()
590 dl->e_sections[dl->e_nsec - 1].s_pad = in GetElfFileInfo()
591 dl->e_sections[dl->e_nsec - 1].s_msize - in GetElfFileInfo()
592 dl->e_sections[dl->e_nsec - 1].s_fsize; in GetElfFileInfo()
596 dl->e_sections[0].s_loff = 0; in GetElfFileInfo()
597 for (i = 1; i < dl->e_nsec; i++) { in GetElfFileInfo()
598 dl->e_sections[i].s_loff = in GetElfFileInfo()
599 dl->e_sections[i - 1].s_loff + in GetElfFileInfo()
600 dl->e_sections[i - 1].s_fsize + in GetElfFileInfo()
601 dl->e_sections[i - 1].s_pad; in GetElfFileInfo()
617 printf("Transfer Address: %08x\n", dl->xferaddr); in GetElfFileInfo()
618 printf("Program Sections: %d\n", dl->e_nsec); in GetElfFileInfo()
619 for (i = 0; i < dl->e_nsec; i++) { in GetElfFileInfo()
621 dl->e_sections[i].s_fsize); in GetElfFileInfo()
623 dl->e_sections[i].s_pad); in GetElfFileInfo()
625 dl->e_machine = e_machine; in GetElfFileInfo()
627 dl->e_curpos = 0; in GetElfFileInfo()
628 dl->e_cursec = 0; in GetElfFileInfo()
668 GetAOutFileInfo(struct dllist *dl) in GetAOutFileInfo() argument
677 if (read(dl->ldfd, (char *)&ex, sizeof(ex)) != sizeof(ex)) in GetAOutFileInfo()
680 (void)lseek(dl->ldfd, (off_t) 0, SEEK_SET); in GetAOutFileInfo()
682 if (read(dl->ldfd, (char *)&ex_swap, in GetAOutFileInfo()
841 dl->image_type = IMAGE_TYPE_AOUT; in GetAOutFileInfo()
842 dl->loadaddr = 0; in GetAOutFileInfo()
843 dl->xferaddr = ex.a_entry; in GetAOutFileInfo()
845 dl->a_text = ex.a_text; in GetAOutFileInfo()
847 dl->a_text_fill = clbytes - (ex.a_text & clofset); in GetAOutFileInfo()
848 if (dl->a_text_fill == clbytes) in GetAOutFileInfo()
849 dl->a_text_fill = 0; in GetAOutFileInfo()
851 dl->a_text_fill = 0; in GetAOutFileInfo()
852 dl->a_data = ex.a_data; in GetAOutFileInfo()
854 dl->a_data_fill = clbytes - (ex.a_data & clofset); in GetAOutFileInfo()
855 if (dl->a_data_fill == clbytes) in GetAOutFileInfo()
856 dl->a_data_fill = 0; in GetAOutFileInfo()
858 dl->a_data_fill = 0; in GetAOutFileInfo()
859 dl->a_bss = ex.a_bss; in GetAOutFileInfo()
861 dl->a_bss_fill = clbytes - (ex.a_bss & clofset); in GetAOutFileInfo()
862 if (dl->a_bss_fill == clbytes) in GetAOutFileInfo()
863 dl->a_bss_fill = 0; in GetAOutFileInfo()
865 dl->a_bss_fill = clbytes - in GetAOutFileInfo()
867 if (dl->a_bss_fill == clbytes) in GetAOutFileInfo()
868 dl->a_bss_fill = 0; in GetAOutFileInfo()
870 dl->a_mid = mid; in GetAOutFileInfo()
877 GetFileInfo(struct dllist *dl) in GetFileInfo() argument
881 error = CheckElfFile(dl->ldfd); in GetFileInfo()
883 error = GetElfFileInfo(dl); in GetFileInfo()
890 error = CheckAOutFile(dl->ldfd); in GetFileInfo()
892 error = GetAOutFileInfo(dl); in GetFileInfo()
899 error = CheckMopFile(dl->ldfd); in GetFileInfo()
901 error = GetMopFileInfo(dl); in GetFileInfo()