summaryrefslogtreecommitdiffstats
path: root/cpukit/libdl
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2020-05-05 14:58:27 +1000
committerChris Johns <chrisj@rtems.org>2020-05-05 14:58:27 +1000
commitb7702c541c563df2d857308fc4d12d818e9b5c3b (patch)
tree6683a4014404bd744db401a3a92590c1c060ff8c /cpukit/libdl
parentlibdl/obj-comp: Add trace prints when decompressing (diff)
downloadrtems-b7702c541c563df2d857308fc4d12d818e9b5c3b.tar.bz2
libdl/rap: Correctly check the return enum from rela calls
- 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
Diffstat (limited to 'cpukit/libdl')
-rw-r--r--cpukit/libdl/rtl-rap.c17
1 files 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;