2010-12-10 10:27:56 +01:00
|
|
|
#ifndef _LIBEXEC_H_
|
|
|
|
#define _LIBEXEC_H_ 1
|
|
|
|
|
2012-04-03 15:52:25 +02:00
|
|
|
#include <sys/exec_elf.h>
|
2010-12-10 10:27:56 +01:00
|
|
|
|
|
|
|
/* a.out routines */
|
|
|
|
int read_header_aout(const char *exec_hdr, size_t exec_len, int *sep_id,
|
|
|
|
vir_bytes *text_bytes, vir_bytes *data_bytes,
|
|
|
|
vir_bytes *bss_bytes, phys_bytes *tot_bytes, vir_bytes *pc,
|
|
|
|
int *hdrlenp);
|
|
|
|
|
|
|
|
/* ELF routines */
|
2012-04-03 15:52:25 +02:00
|
|
|
int read_header_elf(const char *exec_hdr, int hdr_len,
|
2011-04-07 14:22:36 +02:00
|
|
|
vir_bytes *text_vaddr, phys_bytes *text_paddr,
|
|
|
|
vir_bytes *text_filebytes, vir_bytes *text_membytes,
|
|
|
|
vir_bytes *data_vaddr, phys_bytes *data_paddr,
|
|
|
|
vir_bytes *data_filebytes, vir_bytes *data_membytes,
|
|
|
|
vir_bytes *pc, off_t *text_offset, off_t *data_offset);
|
2010-12-10 10:27:56 +01:00
|
|
|
|
2012-04-03 15:52:25 +02:00
|
|
|
int elf_has_interpreter(const char *exec_hdr, int hdr_len, char *interp, int maxsz);
|
|
|
|
int elf_phdr(const char *exec_hdr, int hdr_len, vir_bytes *phdr);
|
|
|
|
|
2010-12-10 10:27:56 +01:00
|
|
|
#endif /* !_LIBEXEC_H_ */
|