[rtems commit] cpukit/libdl/rtl-sym.c: Fix increment of variable

Joel Sherrill joel at rtems.org
Fri Jul 29 13:24:50 UTC 2022


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

Author:    Ryan Long <ryan.long at oarcorp.com>
Date:      Tue Jul 19 11:34:42 2022 -0500

cpukit/libdl/rtl-sym.c: Fix increment of variable

In rtems_rtl_symbol_global_add() the loop that gets to the end of the symbol
table used "unsigned long" to increment the index for the table. For most
architectures this resulted in 4, but with AArch64, it results in 8. This
resulted in the symbols being read in wrong. Changing this to void* along with
changing the RISC-V specific code for 8 byte pointers in rtems-tools to work
independent of the architecture.

Updates #4673
Closes #4682

---

 cpukit/libdl/rtl-sym.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/libdl/rtl-sym.c b/cpukit/libdl/rtl-sym.c
index c29c8c49d6..5c9c3981df 100644
--- a/cpukit/libdl/rtl-sym.c
+++ b/cpukit/libdl/rtl-sym.c
@@ -124,7 +124,7 @@ rtems_rtl_symbol_global_add (rtems_rtl_obj*       obj,
       return false;
     }
     ++count;
-    s += l + sizeof (unsigned long) + 1;
+    s += l + sizeof (void *) + 1;
   }
 
   /*



More information about the vc mailing list