Lines Matching refs:ehdr
83 struct exec ehdr;
89 if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr))
93 if ((ehdr.a_magic & 0xffff) != NMAGIC)
96 if ((N_GETMAGIC(ehdr) != NMAGIC) && (N_GETMAGIC(ehdr) != OMAGIC))
103 textsz = (ehdr.a_text + AOUT_LDPGSZ - 1) & ~(AOUT_LDPGSZ - 1);
105 od->ksize = textsz + ehdr.a_data + ehdr.a_bss;
106 od->kentry = ehdr.a_entry;
108 if (loadsyms && ehdr.a_syms) {
110 if (lseek(fd, ehdr.a_text+ehdr.a_data+ehdr.a_syms+sizeof(ehdr),
117 if (lseek(fd, sizeof(ehdr), 0) <= 0)
119 od->ksize += ehdr.a_syms + sizeof(long) + stringsz;
130 if ((read(fd, (char *)(od->kstart), ehdr.a_text) != ehdr.a_text)
131 ||(read(fd,(char *)(od->kstart+textsz),ehdr.a_data) != ehdr.a_data))
133 memset(od->kstart + textsz + ehdr.a_data, 0, ehdr.a_bss);
138 if (loadsyms && ehdr.a_syms) {
141 p = (long *)((od->kstart) + textsz + ehdr.a_data + ehdr.a_bss);
142 *p++ = ehdr.a_syms;
144 if (read(fd, (char *)p, ehdr.a_syms) != ehdr.a_syms)
146 p = (long *)((char *)p + ehdr.a_syms);