summaryrefslogtreecommitdiff
path: root/nuttx/binfmt/libelf
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-27 00:04:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-27 00:04:47 +0000
commit1ba327bd1c3e895675e7ab504af1064635fdf282 (patch)
tree615048fb87a55a2421efe353d061d0ded0d8eebf /nuttx/binfmt/libelf
parentf1c2ce14060e4442dd59f6fa89e02b23c2d3989d (diff)
downloadpx4-nuttx-1ba327bd1c3e895675e7ab504af1064635fdf282.tar.gz
px4-nuttx-1ba327bd1c3e895675e7ab504af1064635fdf282.tar.bz2
px4-nuttx-1ba327bd1c3e895675e7ab504af1064635fdf282.zip
The ELF loader is basically functional (needs more testing)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5265 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/binfmt/libelf')
-rw-r--r--nuttx/binfmt/libelf/libelf_bind.c5
-rw-r--r--nuttx/binfmt/libelf/libelf_init.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/nuttx/binfmt/libelf/libelf_bind.c b/nuttx/binfmt/libelf/libelf_bind.c
index f41b5a0b6..54ea8f1f0 100644
--- a/nuttx/binfmt/libelf/libelf_bind.c
+++ b/nuttx/binfmt/libelf/libelf_bind.c
@@ -142,7 +142,10 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx,
int ret;
int i;
- /* Examine each relocation in the section */
+ /* Examine each relocation in the section. 'relsec' is the section
+ * containing the relations. 'dstsec' is the section containing the data
+ * to be relocated.
+ */
for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++)
{
diff --git a/nuttx/binfmt/libelf/libelf_init.c b/nuttx/binfmt/libelf/libelf_init.c
index e1b9f73d6..fa4b7983c 100644
--- a/nuttx/binfmt/libelf/libelf_init.c
+++ b/nuttx/binfmt/libelf/libelf_init.c
@@ -154,6 +154,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
/* Get the length of the file. */
ret = elf_filelen(loadinfo, filename);
+ if (ret < 0)
{
bdbg("elf_filelen failed: %d\n", ret);
return ret;