mirror of
https://git.rtems.org/rtems-tools/
synced 2025-06-16 06:51:54 +08:00
fix relocation records order
This commit is contained in:
parent
c14133efaf
commit
f2915943d1
@ -80,6 +80,18 @@ namespace rld
|
||||
*/
|
||||
typedef std::vector < relocation > relocations;
|
||||
|
||||
/**
|
||||
* Relocation symname sorter for the relocations container.
|
||||
*/
|
||||
class reloc_symname_compare
|
||||
{
|
||||
public:
|
||||
bool operator () (const relocation& lhs,
|
||||
const relocation& rhs) const {
|
||||
return lhs.symname < rhs.symname;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Relocation offset sorter for the relocations container.
|
||||
*/
|
||||
@ -88,7 +100,9 @@ namespace rld
|
||||
public:
|
||||
bool operator () (const relocation& lhs,
|
||||
const relocation& rhs) const {
|
||||
return lhs.offset < rhs.offset;
|
||||
if (lhs.symname == rhs.symname)
|
||||
return lhs.offset < rhs.offset;
|
||||
else return false;
|
||||
}
|
||||
};
|
||||
|
||||
@ -681,6 +695,9 @@ namespace rld
|
||||
sec.relocs.push_back (relocation (freloc, offset));
|
||||
}
|
||||
|
||||
std::stable_sort (sec.relocs.begin (),
|
||||
sec.relocs.end (),
|
||||
reloc_symname_compare ());
|
||||
std::stable_sort (sec.relocs.begin (),
|
||||
sec.relocs.end (),
|
||||
reloc_offset_compare ());
|
||||
|
Loading…
x
Reference in New Issue
Block a user