[PATCH 6/7] libdl/rap: Correctly check the return enum from rela calls
chrisj at rtems.org
chrisj at rtems.org
Tue May 5 05:02:06 UTC 2020
From: Chris Johns <chrisj at rtems.org>
- The change from bool to an enum did not trip a compiler warning
and only the rel path was changed. The rela path was missed so
archs like SPARC failed.
Updates #3969
---
cpukit/libdl/rtl-rap.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/cpukit/libdl/rtl-rap.c b/cpukit/libdl/rtl-rap.c
index 4e4540c156..32f4bd6ff5 100644
--- a/cpukit/libdl/rtl-rap.c
+++ b/cpukit/libdl/rtl-rap.c
@@ -326,6 +326,7 @@ rtems_rtl_rap_relocate (rtems_rtl_rap* rap, rtems_rtl_obj* obj)
if (!symsect)
{
free (symname_buffer);
+ rtems_rtl_set_error (EINVAL, "symsect not found: %d", info >> 8);
return false;
}
@@ -389,8 +390,12 @@ rtems_rtl_rap_relocate (rtems_rtl_rap* rap, rtems_rtl_obj* obj)
r, (int) type, offset, (int) addend,
symname, (uintmax_t) symtype, (uintmax_t) symvalue);
- if (!rtems_rtl_elf_relocate_rela (obj, &rela, targetsect,
- symname, symtype, symvalue))
+ if (rtems_rtl_elf_relocate_rela (obj,
+ &rela,
+ targetsect,
+ symname,
+ symtype,
+ symvalue) == rtems_rtl_elf_rel_failure)
{
free (symname_buffer);
return false;
@@ -409,8 +414,12 @@ rtems_rtl_rap_relocate (rtems_rtl_rap* rap, rtems_rtl_obj* obj)
r, (int) type, offset,
symname, (uintmax_t) symtype, (uintmax_t) symvalue);
- if (rtems_rtl_elf_relocate_rel (obj, &rel, targetsect,
- symname, symtype, symvalue) == rtems_rtl_elf_rel_failure)
+ if (rtems_rtl_elf_relocate_rel (obj,
+ &rel,
+ targetsect,
+ symname,
+ symtype,
+ symvalue) == rtems_rtl_elf_rel_failure)
{
free (symname_buffer);
return false;
--
2.24.1
More information about the devel
mailing list