Add a hook in MCELFObjectTargetWriter to allow targets to sort relocation

entries in the relocation table before they are written out to the file. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153345 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka
2012-03-23 23:06:45 +00:00
parent 6fedb3c401
commit 00ca888ccc
3 changed files with 42 additions and 29 deletions
+8
View File
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/ADT/STLExtras.h"
#include "llvm/MC/MCELFObjectWriter.h"
using namespace llvm;
@@ -36,3 +37,10 @@ const MCSymbol *MCELFObjectTargetWriter::ExplicitRelSym(const MCAssembler &Asm,
void MCELFObjectTargetWriter::adjustFixupOffset(const MCFixup &Fixup,
uint64_t &RelocOffset) {
}
void
MCELFObjectTargetWriter::sortRelocs(const MCAssembler &Asm,
std::vector<ELFRelocationEntry> &Relocs) {
// Sort by the r_offset, just like gnu as does.
array_pod_sort(Relocs.begin(), Relocs.end());
}