Simplify MipsRldMapSection::writeTo.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 May 2017 22:04:32 +0000 (22:04 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 24 May 2017 22:04:32 +0000 (22:04 +0000)
It is not clear why a synthetic section wants to use padding defined
in the linker script. The padding is for the space between sections.

It was also missing a test.

llvm-svn: 303812

lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h

index bcfb775..0a12a39 100644 (file)
@@ -2173,16 +2173,6 @@ MipsRldMapSection::MipsRldMapSection()
     : SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, Config->Wordsize,
                        ".rld_map") {}
 
-void MipsRldMapSection::writeTo(uint8_t *Buf) {
-  // Apply filler from linker script.
-  uint64_t Filler = Script->getCmd(this->OutSec)->getFiller();
-  if (Filler == 0)
-    return;
-
-  Filler = (Filler << 32) | Filler;
-  memcpy(Buf, &Filler, getSize());
-}
-
 ARMExidxSentinelSection::ARMExidxSentinelSection()
     : SyntheticSection(SHF_ALLOC | SHF_LINK_ORDER, SHT_ARM_EXIDX,
                        Config->Wordsize, ".ARM.exidx") {}
index c5ffb88..8ff155d 100644 (file)
@@ -709,7 +709,7 @@ class MipsRldMapSection : public SyntheticSection {
 public:
   MipsRldMapSection();
   size_t getSize() const override { return Config->Wordsize; }
-  void writeTo(uint8_t *Buf) override;
+  void writeTo(uint8_t *Buf) override {}
 };
 
 class ARMExidxSentinelSection : public SyntheticSection {