]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp
MFC r234353:
[FreeBSD/stable/9.git] / contrib / llvm / lib / MC / MCELFObjectTargetWriter.cpp
1 //===-- MCELFObjectTargetWriter.cpp - ELF Target Writer Subclass ----------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "llvm/ADT/STLExtras.h"
11 #include "llvm/MC/MCELFObjectWriter.h"
12
13 using namespace llvm;
14
15 MCELFObjectTargetWriter::MCELFObjectTargetWriter(bool Is64Bit_,
16                                                  uint8_t OSABI_,
17                                                  uint16_t EMachine_,
18                                                  bool HasRelocationAddend_)
19   : OSABI(OSABI_), EMachine(EMachine_),
20     HasRelocationAddend(HasRelocationAddend_), Is64Bit(Is64Bit_) {
21 }
22
23 /// Default e_flags = 0
24 unsigned MCELFObjectTargetWriter::getEFlags() const {
25   return 0;
26 }
27
28 const MCSymbol *MCELFObjectTargetWriter::ExplicitRelSym(const MCAssembler &Asm,
29                                                         const MCValue &Target,
30                                                         const MCFragment &F,
31                                                         const MCFixup &Fixup,
32                                                         bool IsPCRel) const {
33   return NULL;
34 }
35
36
37 void MCELFObjectTargetWriter::adjustFixupOffset(const MCFixup &Fixup,
38                                                 uint64_t &RelocOffset) {
39 }
40
41 void
42 MCELFObjectTargetWriter::sortRelocs(const MCAssembler &Asm,
43                                     std::vector<ELFRelocationEntry> &Relocs) {
44   // Sort by the r_offset, just like gnu as does.
45   array_pod_sort(Relocs.begin(), Relocs.end());
46 }