Small structs for PPC64 SVR4 must be passed right-justified in registers.
[oota-llvm.git] / 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                                                  bool IsN64_)
20   : OSABI(OSABI_), EMachine(EMachine_),
21     HasRelocationAddend(HasRelocationAddend_), Is64Bit(Is64Bit_),
22     IsN64(IsN64_){
23 }
24
25 /// Default e_flags = 0
26 unsigned MCELFObjectTargetWriter::getEFlags() const {
27   return 0;
28 }
29
30 const MCSymbol *MCELFObjectTargetWriter::ExplicitRelSym(const MCAssembler &Asm,
31                                                         const MCValue &Target,
32                                                         const MCFragment &F,
33                                                         const MCFixup &Fixup,
34                                                         bool IsPCRel) const {
35   return NULL;
36 }
37
38
39 void MCELFObjectTargetWriter::adjustFixupOffset(const MCFixup &Fixup,
40                                                 uint64_t &RelocOffset) {
41 }
42
43 void
44 MCELFObjectTargetWriter::sortRelocs(const MCAssembler &Asm,
45                                     std::vector<ELFRelocationEntry> &Relocs) {
46   // Sort by the r_offset, just like gnu as does.
47   array_pod_sort(Relocs.begin(), Relocs.end());
48 }