| 306 |
static int load_aout_interp(void * exptr, int interp_fd); |
static int load_aout_interp(void * exptr, int interp_fd); |
| 307 |
|
|
| 308 |
#ifdef BSWAP_NEEDED |
#ifdef BSWAP_NEEDED |
| 309 |
static void bswap_ehdr(Elf32_Ehdr *ehdr) |
static void bswap_ehdr(struct elfhdr *ehdr) |
| 310 |
{ |
{ |
| 311 |
bswap16s(&ehdr->e_type); /* Object file type */ |
bswap16s(&ehdr->e_type); /* Object file type */ |
| 312 |
bswap16s(&ehdr->e_machine); /* Architecture */ |
bswap16s(&ehdr->e_machine); /* Architecture */ |
| 313 |
bswap32s(&ehdr->e_version); /* Object file version */ |
bswap32s(&ehdr->e_version); /* Object file version */ |
| 314 |
bswap32s(&ehdr->e_entry); /* Entry point virtual address */ |
bswaptls(&ehdr->e_entry); /* Entry point virtual address */ |
| 315 |
bswap32s(&ehdr->e_phoff); /* Program header table file offset */ |
bswaptls(&ehdr->e_phoff); /* Program header table file offset */ |
| 316 |
bswap32s(&ehdr->e_shoff); /* Section header table file offset */ |
bswaptls(&ehdr->e_shoff); /* Section header table file offset */ |
| 317 |
bswap32s(&ehdr->e_flags); /* Processor-specific flags */ |
bswap32s(&ehdr->e_flags); /* Processor-specific flags */ |
| 318 |
bswap16s(&ehdr->e_ehsize); /* ELF header size in bytes */ |
bswap16s(&ehdr->e_ehsize); /* ELF header size in bytes */ |
| 319 |
bswap16s(&ehdr->e_phentsize); /* Program header table entry size */ |
bswap16s(&ehdr->e_phentsize); /* Program header table entry size */ |
| 323 |
bswap16s(&ehdr->e_shstrndx); /* Section header string table index */ |
bswap16s(&ehdr->e_shstrndx); /* Section header string table index */ |
| 324 |
} |
} |
| 325 |
|
|
| 326 |
static void bswap_phdr(Elf32_Phdr *phdr) |
static void bswap_phdr(struct elf_phdr *phdr) |
| 327 |
{ |
{ |
| 328 |
bswap32s(&phdr->p_type); /* Segment type */ |
bswap32s(&phdr->p_type); /* Segment type */ |
| 329 |
bswap32s(&phdr->p_offset); /* Segment file offset */ |
bswaptls(&phdr->p_offset); /* Segment file offset */ |
| 330 |
bswap32s(&phdr->p_vaddr); /* Segment virtual address */ |
bswaptls(&phdr->p_vaddr); /* Segment virtual address */ |
| 331 |
bswap32s(&phdr->p_paddr); /* Segment physical address */ |
bswaptls(&phdr->p_paddr); /* Segment physical address */ |
| 332 |
bswap32s(&phdr->p_filesz); /* Segment size in file */ |
bswaptls(&phdr->p_filesz); /* Segment size in file */ |
| 333 |
bswap32s(&phdr->p_memsz); /* Segment size in memory */ |
bswaptls(&phdr->p_memsz); /* Segment size in memory */ |
| 334 |
bswap32s(&phdr->p_flags); /* Segment flags */ |
bswap32s(&phdr->p_flags); /* Segment flags */ |
| 335 |
bswap32s(&phdr->p_align); /* Segment alignment */ |
bswaptls(&phdr->p_align); /* Segment alignment */ |
| 336 |
} |
} |
| 337 |
|
|
| 338 |
static void bswap_shdr(Elf32_Shdr *shdr) |
static void bswap_shdr(struct elf_shdr *shdr) |
| 339 |
{ |
{ |
| 340 |
bswap32s(&shdr->sh_name); |
bswap32s(&shdr->sh_name); |
| 341 |
bswap32s(&shdr->sh_type); |
bswap32s(&shdr->sh_type); |
| 342 |
bswap32s(&shdr->sh_flags); |
bswaptls(&shdr->sh_flags); |
| 343 |
bswap32s(&shdr->sh_addr); |
bswaptls(&shdr->sh_addr); |
| 344 |
bswap32s(&shdr->sh_offset); |
bswaptls(&shdr->sh_offset); |
| 345 |
bswap32s(&shdr->sh_size); |
bswaptls(&shdr->sh_size); |
| 346 |
bswap32s(&shdr->sh_link); |
bswap32s(&shdr->sh_link); |
| 347 |
bswap32s(&shdr->sh_info); |
bswap32s(&shdr->sh_info); |
| 348 |
bswap32s(&shdr->sh_addralign); |
bswaptls(&shdr->sh_addralign); |
| 349 |
bswap32s(&shdr->sh_entsize); |
bswaptls(&shdr->sh_entsize); |
| 350 |
} |
} |
| 351 |
|
|
| 352 |
static void bswap_sym(Elf32_Sym *sym) |
static void bswap_sym(Elf32_Sym *sym) |