mirror of https://github.com/ipxe/ipxe.git
Create include/gpxe/elf.h for the ELF bits that aren't part of the ELF
standard and so don't belong in include/elf.hpull/1/head
parent
0010e10ef3
commit
230f16538f
|
@ -27,19 +27,12 @@
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
#include <gpxe/uaccess.h>
|
#include <gpxe/uaccess.h>
|
||||||
#include <gpxe/segment.h>
|
#include <gpxe/segment.h>
|
||||||
|
#include <gpxe/elf.h>
|
||||||
|
|
||||||
typedef Elf32_Ehdr Elf_Ehdr;
|
typedef Elf32_Ehdr Elf_Ehdr;
|
||||||
typedef Elf32_Phdr Elf_Phdr;
|
typedef Elf32_Phdr Elf_Phdr;
|
||||||
typedef Elf32_Off Elf_Off;
|
typedef Elf32_Off Elf_Off;
|
||||||
|
|
||||||
/** An ELF file */
|
|
||||||
struct elf {
|
|
||||||
/** ELF file image */
|
|
||||||
userptr_t image;
|
|
||||||
/** Length of ELF file image */
|
|
||||||
size_t len;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load ELF segment into memory
|
* Load ELF segment into memory
|
||||||
*
|
*
|
||||||
|
@ -126,5 +119,8 @@ int elf_load ( struct elf *elf ) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fill in entry point address */
|
||||||
|
elf->entry = ehdr.e_entry;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef _GPXE_ELF_H
|
||||||
|
#define _GPXE_ELF_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* ELF image format
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <elf.h>
|
||||||
|
|
||||||
|
/** An ELF file */
|
||||||
|
struct elf {
|
||||||
|
/** ELF file image */
|
||||||
|
userptr_t image;
|
||||||
|
/** Length of ELF file image */
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
/** Entry point */
|
||||||
|
physaddr_t entry;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern int elf_load ( struct elf *elf );
|
||||||
|
|
||||||
|
#endif /* _GPXE_ELF_H */
|
Loading…
Reference in New Issue