mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
binfmt: Fix offset value when calling elf_read() in elf_sectname()
Jira: PDFW15IS-3030 Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
721512c83a
commit
c109e92962
1 changed files with 1 additions and 2 deletions
|
@ -114,7 +114,6 @@ static inline int elf_sectname(FAR struct elf_loadinfo_s *loadinfo,
|
|||
|
||||
/* Loop until we get the entire section name into memory */
|
||||
|
||||
buffer = loadinfo->iobuffer;
|
||||
bytesread = 0;
|
||||
|
||||
for (; ; )
|
||||
|
@ -136,7 +135,7 @@ static inline int elf_sectname(FAR struct elf_loadinfo_s *loadinfo,
|
|||
/* Read that number of bytes into the array */
|
||||
|
||||
buffer = &loadinfo->iobuffer[bytesread];
|
||||
ret = elf_read(loadinfo, buffer, readlen, offset);
|
||||
ret = elf_read(loadinfo, buffer, readlen, offset + bytesread);
|
||||
if (ret < 0)
|
||||
{
|
||||
berr("Failed to read section name\n");
|
||||
|
|
Loading…
Reference in a new issue