From b25e5ca78a597a17f3a0fab5405db9d601a562be Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 1 Mar 2013 15:42:08 +1100 Subject: Fix RELA in RAP formats. Fixed the RELA handling in the merging of the object sections into the RAP sections. A method in the rap::image class was not being used any more and that code transferred the RELA setting from the object sections to the image section. This change adds also transfers the rela field. --- rld-rap.cpp | 28 +++------------------------- rtems-rapper.cpp | 5 ++++- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/rld-rap.cpp b/rld-rap.cpp index b198017..8b3bbcb 100644 --- a/rld-rap.cpp +++ b/rld-rap.cpp @@ -364,14 +364,6 @@ namespace rld */ void clear (); - /** - * Update the section values. - * - * @param index The RAP section index to update. - * @param sec The object's RAP section. - */ - void update_section (int index, section& sec); - /** * Report the RAP section's size. */ @@ -550,6 +542,7 @@ namespace rld std::cout << ' ' << name << ": size: " << size (offset) << " offset: " << offset + << " rela: " << (rela ? "yes" : "no") << std::endl; for (osecindexes::const_iterator osi = osindexes.begin (); @@ -648,6 +641,7 @@ namespace rld << " offset=" << offset << " fsec.size=" << fsec.size << " fsec.alignment=" << fsec.alignment + << " fsec.rela=" << fsec.rela << " " << obj.obj.name ().full () << std::endl; /* @@ -888,6 +882,7 @@ namespace rld obj.secs[s].set_offset (pobj.secs[s]); sec_size[s] = obj.secs[s].offset + obj.secs[s].size (); sec_align[s] = obj.secs[s].alignment (); + sec_rela[s] = obj.secs[s].rela; } ++poi; } @@ -1388,23 +1383,6 @@ namespace rld fini_off = 0; } - void - image::update_section (int index, section& sec) - { - uint32_t in = sec_size[index]; - sec_size[index] = align_offset (sec_size[index], sec.size (), sec.alignment ()); - sec_align[index] = sec.alignment (); - sec_rela[index] = sec.rela; - - if (rld::verbose () >= RLD_VERBOSE_FULL_DEBUG) - std::cout << "rap:image::update-section: " << section_names[index] - << " offset=" << in - << " sec_size=" << sec_size[index] - << " sec_align=" << sec_align[index] - << " sec.size=" << sec.size () - << std::endl; - } - uint32_t image::section_size (sections sec) const { diff --git a/rtems-rapper.cpp b/rtems-rapper.cpp index 6c8315b..af7ba81 100644 --- a/rtems-rapper.cpp +++ b/rtems-rapper.cpp @@ -750,8 +750,11 @@ rap_show (rld::files::paths& raps, { if (r.secs[s].relocs.size ()) { + const char* rela = r.secs[s].rela ? "(A)" : " "; std::cout << std::setw (16) << r.secs[s].name - << ": info offset addend symbol name" << std::endl; + << ": info offset addend " + << rela + << " symbol name" << std::endl; for (size_t f = 0; f < r.secs[s].relocs.size (); ++f) { rap::relocation& reloc = r.secs[s].relocs[f]; -- cgit v1.2.3