[PATCH] D33512: Simplify MipsRldMapSection::writeTo

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 11:19:07 PDT 2017


rafael created this revision.
Herald added subscribers: arichardson, emaste.

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.


https://reviews.llvm.org/D33512

Files:
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h


Index: ELF/SyntheticSections.h
===================================================================
--- ELF/SyntheticSections.h
+++ ELF/SyntheticSections.h
@@ -709,7 +709,7 @@
 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 {
Index: ELF/SyntheticSections.cpp
===================================================================
--- ELF/SyntheticSections.cpp
+++ ELF/SyntheticSections.cpp
@@ -2173,16 +2173,6 @@
     : 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") {}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33512.100139.patch
Type: text/x-patch
Size: 1166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170524/75bf9ec3/attachment.bin>


More information about the llvm-commits mailing list