aboutsummaryrefslogtreecommitdiff
path: root/nuttx/binfmt/libelf/libelf_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/binfmt/libelf/libelf_load.c')
-rw-r--r--nuttx/binfmt/libelf/libelf_load.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/nuttx/binfmt/libelf/libelf_load.c b/nuttx/binfmt/libelf/libelf_load.c
index 9378661e3..6526004f7 100644
--- a/nuttx/binfmt/libelf/libelf_load.c
+++ b/nuttx/binfmt/libelf/libelf_load.c
@@ -40,7 +40,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <stdint.h>
#include <stdlib.h>
@@ -77,49 +76,6 @@
****************************************************************************/
/****************************************************************************
- * Name: elf_filelen
- *
- * Description:
- * Get the size of the ELF file
- *
- * Returned Value:
- * 0 (OK) is returned on success and a negated errno is returned on
- * failure.
- *
- ****************************************************************************/
-
-static inline int elf_filelen(FAR struct elf_loadinfo_s *loadinfo)
-{
- struct stat buf;
- int ret;
-
- /* Get the file stats */
-
- ret = fstat(loadinfo->filfd, &buf);
- if (ret < 0)
- {
- int errval = errno;
- bdbg("Failed to fstat file: %d\n", errval);
- return -errval;
- }
-
- /* Verify that it is a regular file */
-
- if (!S_ISREG(buf.st_mode))
- {
- bdbg("Not a regular file. mode: %d\n", buf.st_mode);
- return -ENOENT;
- }
-
- /* TODO: Verify that the file is readable */
-
- /* Return the size of the file in the loadinfo structure */
-
- loadinfo->filelen = buf.st_size;
- return OK;
-}
-
-/****************************************************************************
* Name: elf_loadshdrs
*
* Description:
@@ -323,14 +279,6 @@ int elf_load(FAR struct elf_loadinfo_s *loadinfo)
bvdbg("loadinfo: %p\n", loadinfo);
DEBUGASSERT(loadinfo && loadinfo->filfd >= 0);
- /* Get the length of the file. */
-
- ret = elf_filelen(loadinfo);
- {
- bdbg("elf_filelen failed: %d\n", ret);
- return ret;
- }
-
/* Load section headers into memory */
ret = elf_loadshdrs(loadinfo);