Changeset f43851a in rtems-tools


Ignore:
Timestamp:
Dec 31, 2012, 7:29:10 AM (7 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, master
Children:
6801aa2
Parents:
4e7ec70
Message:

Sort the relocation records by offset for a section.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • linkers/rld-rap.cpp

    r4e7ec70 rf43851a  
    7575     * Relocation records.
    7676     */
    77     typedef std::list < relocation > relocations;
     77    typedef std::vector < relocation > relocations;
     78
     79    /**
     80     * Relocation offset sorter for the relocations container.
     81     */
     82    class reloc_offset_compare
     83    {
     84    public:
     85      bool operator () (const relocation& lhs,
     86                        const relocation& rhs) const {
     87        return lhs.offset < rhs.offset;
     88      }
     89    };
    7890
    7991    /**
     
    669681        sec.relocs.push_back (relocation (freloc, offset));
    670682      }
     683
     684      std::stable_sort (sec.relocs.begin (),
     685                        sec.relocs.end (),
     686                        reloc_offset_compare ());
    671687
    672688      sec.rela = fsec.rela;
Note: See TracChangeset for help on using the changeset viewer.