Switch from WriteEFlags to getEFlags in preparation for moving it
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Dec 2011 20:09:46 +0000 (20:09 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Dec 2011 20:09:46 +0000 (20:09 +0000)
to Target/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147087 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/ELFObjectWriter.cpp
lib/MC/ELFObjectWriter.h

index 8918097d3d3b1c27c15b564f4f1bdc2bc514fe39..cb8b4e14b6fad7b6e575a113a5318ba36c24abd4 100644 (file)
@@ -108,7 +108,7 @@ void ELFObjectWriter::WriteHeader(uint64_t SectionDataSize,
             sizeof(ELF::Elf32_Ehdr)));  // e_shoff = sec hdr table off in bytes
 
   // e_flags = whatever the target wants
-  WriteEFlags();
+  Write32(getEFlags());
 
   // e_ehsize = ELF header size
   Write16(is64Bit() ? sizeof(ELF::Elf64_Ehdr) : sizeof(ELF::Elf32_Ehdr));
@@ -1296,8 +1296,8 @@ ARMELFObjectWriter::~ARMELFObjectWriter()
 {}
 
 // FIXME: get the real EABI Version from the Triple.
-void ARMELFObjectWriter::WriteEFlags() {
-  Write32(ELF::EF_ARM_EABIMASK & DefaultEABIVersion);
+unsigned ARMELFObjectWriter::getEFlags() {
+  return ELF::EF_ARM_EABIMASK & DefaultEABIVersion;
 }
 
 // In ARM, _MergedGlobals and other most symbols get emitted directly.
@@ -1646,9 +1646,8 @@ MipsELFObjectWriter::MipsELFObjectWriter(MCELFObjectTargetWriter *MOTW,
 MipsELFObjectWriter::~MipsELFObjectWriter() {}
 
 // FIXME: get the real EABI Version from the Triple.
-void MipsELFObjectWriter::WriteEFlags() {
-  Write32(ELF::EF_MIPS_NOREORDER |
-          ELF::EF_MIPS_ARCH_32R2);
+unsigned MipsELFObjectWriter::getEFlags() {
+  return ELF::EF_MIPS_NOREORDER | ELF::EF_MIPS_ARCH_32R2;
 }
 
 const MCSymbol *MipsELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,
index 32ab198fd5d9a8486f42db9e1e6898ded9ead51b..653b8212bde2155984a9b3569c217c5f4e3f88f3 100644 (file)
@@ -244,7 +244,7 @@ class ELFObjectWriter : public MCObjectWriter {
                              unsigned NumberOfSections);
 
     /// Default e_flags = 0
-    virtual void WriteEFlags() { Write32(0); }
+    virtual unsigned getEFlags() { return 0; }
 
     virtual void WriteSymbolEntry(MCDataFragment *SymtabF,
                                   MCDataFragment *ShndxF,
@@ -369,7 +369,7 @@ class ELFObjectWriter : public MCObjectWriter {
 
     virtual ~ARMELFObjectWriter();
 
-    virtual void WriteEFlags();
+    virtual unsigned getEFlags();
   protected:
     virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm,
                                            const MCValue &Target,
@@ -425,7 +425,7 @@ class ELFObjectWriter : public MCObjectWriter {
                         bool IsLittleEndian);
 
     virtual ~MipsELFObjectWriter();
-    virtual void WriteEFlags();
+    virtual unsigned getEFlags();
 
   protected:
     virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm,