elfload.c (768a4a36a444ef5aef1f103adf42553eadfe4614) | elfload.c (7a3148a955e3350720a01f57163ab230b72aca7e) |
---|---|
1/* This is the Linux kernel elf-loading code, ported into user space */ 2 3#include <stdio.h> 4#include <sys/types.h> 5#include <fcntl.h> 6#include <errno.h> 7#include <unistd.h> 8#include <sys/mman.h> --- 299 unchanged lines hidden (view full) --- 308 regs->pc = infop->entry; 309} 310 311#define USE_ELF_CORE_DUMP 312#define ELF_EXEC_PAGESIZE 8192 313 314#endif 315 | 1/* This is the Linux kernel elf-loading code, ported into user space */ 2 3#include <stdio.h> 4#include <sys/types.h> 5#include <fcntl.h> 6#include <errno.h> 7#include <unistd.h> 8#include <sys/mman.h> --- 299 unchanged lines hidden (view full) --- 308 regs->pc = infop->entry; 309} 310 311#define USE_ELF_CORE_DUMP 312#define ELF_EXEC_PAGESIZE 8192 313 314#endif 315 |
316#ifdef TARGET_ALPHA 317 318#define ELF_START_MMAP (0x30000000000ULL) 319 320#define elf_check_arch(x) ( (x) == ELF_ARCH ) 321 322#define ELF_CLASS ELFCLASS64 323#define ELF_DATA ELFDATA2MSB 324#define ELF_ARCH EM_ALPHA 325 326static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) 327{ 328 regs->pc = infop->entry; 329 regs->ps = 8; 330 regs->usp = infop->start_stack; 331 regs->unique = infop->start_data; /* ? */ 332 printf("Set unique value to " TARGET_FMT_lx " (" TARGET_FMT_lx ")\n", 333 regs->unique, infop->start_data); 334} 335 336#define USE_ELF_CORE_DUMP 337#define ELF_EXEC_PAGESIZE 8192 338 339#endif /* TARGET_ALPHA */ 340 |
|
316#ifndef ELF_PLATFORM 317#define ELF_PLATFORM (NULL) 318#endif 319 320#ifndef ELF_HWCAP 321#define ELF_HWCAP 0 322#endif 323 --- 102 unchanged lines hidden (view full) --- 426 bswaptls(&shdr->sh_offset); 427 bswaptls(&shdr->sh_size); 428 bswap32s(&shdr->sh_link); 429 bswap32s(&shdr->sh_info); 430 bswaptls(&shdr->sh_addralign); 431 bswaptls(&shdr->sh_entsize); 432} 433 | 341#ifndef ELF_PLATFORM 342#define ELF_PLATFORM (NULL) 343#endif 344 345#ifndef ELF_HWCAP 346#define ELF_HWCAP 0 347#endif 348 --- 102 unchanged lines hidden (view full) --- 451 bswaptls(&shdr->sh_offset); 452 bswaptls(&shdr->sh_size); 453 bswap32s(&shdr->sh_link); 454 bswap32s(&shdr->sh_info); 455 bswaptls(&shdr->sh_addralign); 456 bswaptls(&shdr->sh_entsize); 457} 458 |
434static void bswap_sym(Elf32_Sym *sym) | 459static void bswap_sym(struct elf_sym *sym) |
435{ 436 bswap32s(&sym->st_name); | 460{ 461 bswap32s(&sym->st_name); |
437 bswap32s(&sym->st_value); 438 bswap32s(&sym->st_size); | 462 bswaptls(&sym->st_value); 463 bswaptls(&sym->st_size); |
439 bswap16s(&sym->st_shndx); 440} 441#endif 442 443/* 444 * 'copy_elf_strings()' copies argument/envelope strings from user 445 * memory to free pages in kernel mem. These are in a format ready 446 * to be put directly into the top of new user memory. --- 822 unchanged lines hidden --- | 464 bswap16s(&sym->st_shndx); 465} 466#endif 467 468/* 469 * 'copy_elf_strings()' copies argument/envelope strings from user 470 * memory to free pages in kernel mem. These are in a format ready 471 * to be put directly into the top of new user memory. --- 822 unchanged lines hidden --- |