[rtems commit] libdl/sparc: Print trace message of reloc failture path

Chris Johns chrisj at rtems.org
Tue May 5 05:03:32 UTC 2020


Module:    rtems
Branch:    master
Commit:    fe77587c64b4322cfeaf2dd36b3ef5b6d73acb10
Changeset: http://git.rtems.org/rtems/commit/?id=fe77587c64b4322cfeaf2dd36b3ef5b6d73acb10

Author:    Chris Johns <chrisj at rtems.org>
Date:      Tue May  5 14:53:53 2020 +1000

libdl/sparc: Print trace message of reloc failture path

Updates #3969

---

 cpukit/libdl/rtl-mdreloc-sparc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cpukit/libdl/rtl-mdreloc-sparc.c b/cpukit/libdl/rtl-mdreloc-sparc.c
index 548c241..f8a4312 100644
--- a/cpukit/libdl/rtl-mdreloc-sparc.c
+++ b/cpukit/libdl/rtl-mdreloc-sparc.c
@@ -232,8 +232,11 @@ rtems_rtl_elf_relocate_rela (rtems_rtl_obj*            obj,
    * We use the fact that relocation types are an `enum'
    * Note: R_SPARC_6 is currently numerically largest.
    */
-  if (type > R_TYPE(6))
+  if (type > R_TYPE(TLS_TPOFF64)) {
+    if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC))
+      printf("rtl: invalid reloc type: %d\n", (int) type);
     return rtems_rtl_elf_rel_failure;
+  }
 
   value = rela->r_addend;
 



More information about the vc mailing list