summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-24 23:40:31 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-24 23:40:31 +0000
commit571f43ec01f49a9630b10c4c3c8a224f0aeb01ee (patch)
tree714baa74493bc9615430f984d8caab4a5646dc76 /nuttx/include
parentded016c6fbd656792ca99872cc717df581fe7910 (diff)
downloadpx4-nuttx-571f43ec01f49a9630b10c4c3c8a224f0aeb01ee.tar.gz
px4-nuttx-571f43ec01f49a9630b10c4c3c8a224f0aeb01ee.tar.bz2
px4-nuttx-571f43ec01f49a9630b10c4c3c8a224f0aeb01ee.zip
A little more ELF loader logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5253 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/elf.h9
-rw-r--r--nuttx/include/nuttx/binfmt/elf.h38
2 files changed, 11 insertions, 36 deletions
diff --git a/nuttx/include/elf.h b/nuttx/include/elf.h
index 31818249f..dbc615dcd 100644
--- a/nuttx/include/elf.h
+++ b/nuttx/include/elf.h
@@ -86,16 +86,17 @@
/* Ehe ELF identifier */
#define EI_MAG0 0 /* File identification */
-#define EI_MAG1 1 /* File identification */
-#define EI_MAG2 2 /* File identification */
-#define EI_MAG3 3 /* File identification */
+#define EI_MAG1 1 /* " " " " */
+#define EI_MAG2 2 /* " " " " */
+#define EI_MAG3 3 /* " " " " */
#define EI_CLASS 4 /* File class */
#define EI_DATA 5 /* Data encoding */
#define EI_VERSION 6 /* File version */
#define EI_PAD 7 /* Start of padding bytes */
#define EI_NIDENT 16 /* Size of eident[] */
-#define EI_MAGIC { 0x7f, 'E', 'L', 'F' }
+#define EI_MAGIC_SIZE 4
+#define EI_MAGIC {0x7f, 'E', 'L', 'F'}
/* Values for EI_CLASS */
diff --git a/nuttx/include/nuttx/binfmt/elf.h b/nuttx/include/nuttx/binfmt/elf.h
index 8937790b1..95db7d16f 100644
--- a/nuttx/include/nuttx/binfmt/elf.h
+++ b/nuttx/include/nuttx/binfmt/elf.h
@@ -60,38 +60,12 @@
struct elf_loadinfo_s
{
- /* Instruction Space (ISpace): This region contains the ELF file header
- * plus everything from the text section. Ideally, will have only one mmap'ed
- * text section instance in the system for each module.
- */
-
- uint32_t ispace; /* Address where hdr/text is loaded */
- uint32_t entryoffs; /* Offset from ispace to entry point */
- uint32_t isize; /* Size of ispace. */
-
- /* Data Space (DSpace): This region contains all information that in referenced
- * as data (other than the stack which is separately allocated). There will be
- * a unique instance of DSpace (and stack) for each instance of a process.
- */
-
- FAR struct dspace_s *dspace; /* Allocated D-Space (data/bss/etc) */
- uint32_t datasize; /* Size of data segment in dspace */
- uint32_t bsssize; /* Size of bss segment in dspace */
- uint32_t stacksize; /* Size of stack (not allocated) */
- uint32_t dsize; /* Size of dspace (may be large than parts) */
-
- /* This is temporary memory where relocation records will be loaded. */
-
- uint32_t relocstart; /* Start of array of struct flat_reloc */
- uint16_t reloccount; /* Number of elements in reloc array */
-
- /* File descriptors */
-
- int filfd; /* Descriptor for the file being loaded */
-
- /* This is a copy of the ELF header */
-
- Elf32_Ehdr header;
+ uintptr_t alloc; /* Allocated memory with the ELF file is loaded */
+ size_t allocsize; /* Size of the memory allocation */
+ off_t filelen; /* Length of the entire ELF file */
+ int filfd; /* Descriptor for the file being loaded */
+ Elf32_Ehdr ehdr; /* Buffered ELF file header */
+ FAR Elf32_Shdr *shdr; /* Buffered ELF section headers */
};
/****************************************************************************