mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 02:48:37 +08:00
binfmt/libelf: Fix return code
Fix return code in case of error in loading constructor and destructor section. Detected by Codesonar 54667871, 54667873
This commit is contained in:
parent
1816d752af
commit
5e81726f21
2 changed files with 2 additions and 2 deletions
|
@ -99,7 +99,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo)
|
|||
*/
|
||||
|
||||
binfo("elf_findsection .ctors section failed: %d\n", ctoridx);
|
||||
return ret == -ENOENT ? OK : ret;
|
||||
return ctoridx == -ENOENT ? OK : ctoridx;
|
||||
}
|
||||
|
||||
/* Now we can get a pointer to the .ctor section in the section header
|
||||
|
|
|
@ -100,7 +100,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo)
|
|||
*/
|
||||
|
||||
binfo("elf_findsection .dtors section failed: %d\n", dtoridx);
|
||||
return ret == -ENOENT ? OK : ret;
|
||||
return dtoridx == -ENOENT ? OK : dtoridx;
|
||||
}
|
||||
|
||||
/* Now we can get a pointer to the .dtor section in the section header
|
||||
|
|
Loading…
Reference in a new issue