[rtems-tools commit] linkers/ld: Output all reloc records to the RAP file

Chris Johns chrisj at rtems.org
Tue May 5 01:32:19 UTC 2020


Module:    rtems-tools
Branch:    master
Commit:    6de89d9268f3019f2eb9cf7e1ad8102792d6a428
Changeset: http://git.rtems.org/rtems-tools/commit/?id=6de89d9268f3019f2eb9cf7e1ad8102792d6a428

Author:    Chris Johns <chrisj at rtems.org>
Date:      Tue May  5 11:31:04 2020 +1000

linkers/ld: Output all reloc records to the RAP file

Updates #3969

---

 rtemstoolkit/rld-rap.cpp | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/rtemstoolkit/rld-rap.cpp b/rtemstoolkit/rld-rap.cpp
index 809b6d1..18bd763 100644
--- a/rtemstoolkit/rld-rap.cpp
+++ b/rtemstoolkit/rld-rap.cpp
@@ -924,7 +924,7 @@ namespace rld
     {
       uint32_t relocs = 0;
       for (int s = 0; s < rap_secs; ++s)
-        relocs += secs[s].relocs.size ();
+        relocs += get_relocations (s);
       return relocs;
     }
 
@@ -1355,6 +1355,8 @@ namespace rld
     void
     image::write_relocations (compress::compressor& comp)
     {
+      uint32_t rr = 0;
+
       for (int s = 0; s < rap_secs; ++s)
       {
         uint32_t count = get_relocations (s);
@@ -1390,7 +1392,7 @@ namespace rld
 
           for (relocations::const_iterator ri = relocs.begin ();
                ri != relocs.end ();
-               ++ri, ++sr, ++rc)
+               ++ri)
           {
             const relocation& reloc = *ri;
             uint32_t          info = GELF_R_TYPE (reloc.info);
@@ -1399,12 +1401,6 @@ namespace rld
             bool              write_addend = sec.rela;
             bool              write_symname = false;
 
-            /*
-             * Ignore section index 0
-             */
-            if (reloc.symsect == 0)
-              continue;
-
             offset = sec.offset + reloc.offset;
 
             if (rld::verbose () >= RLD_VERBOSE_TRACE)
@@ -1504,6 +1500,10 @@ namespace rld
 
             if (write_symname)
               comp << reloc.symname;
+
+            ++rc;
+            ++sr;
+            ++rr;
           }
         }
       }
@@ -1723,7 +1723,8 @@ namespace rld
                        compressor.transferred ()) % 10;
         std::cout << "rap: objects: " << app_objects.size ()
                   << ", size: " << compressor.compressed ()
-                  << ", compression: " << pcent << '.' << premand << '%'
+                  << ", expanded: " << compressor.transferred ()
+                  << ", compressed: " << pcent << '.' << premand << '%'
                   << std::endl;
       }
     }



More information about the vc mailing list