[PATCH] D22615: [ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 00:56:23 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL276253: [ELF] - Linkerscript: remove excessive ScriptConfiguration::Filler field (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D22615?vs=64833&id=64834#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22615

Files:
  lld/trunk/ELF/LinkerScript.cpp
  lld/trunk/ELF/LinkerScript.h

Index: lld/trunk/ELF/LinkerScript.h
===================================================================
--- lld/trunk/ELF/LinkerScript.h
+++ lld/trunk/ELF/LinkerScript.h
@@ -86,9 +86,6 @@
   // SECTIONS commands.
   std::vector<SectionRule> Sections;
 
-  // Section fill attribute for each section.
-  llvm::StringMap<std::vector<uint8_t>> Filler;
-
   // Used to assign addresses to sections.
   std::vector<std::unique_ptr<BaseCommand>> Commands;
 
Index: lld/trunk/ELF/LinkerScript.cpp
===================================================================
--- lld/trunk/ELF/LinkerScript.cpp
+++ lld/trunk/ELF/LinkerScript.cpp
@@ -410,10 +410,11 @@
 
 template <class ELFT>
 ArrayRef<uint8_t> LinkerScript<ELFT>::getFiller(StringRef Name) {
-  auto I = Opt.Filler.find(Name);
-  if (I == Opt.Filler.end())
-    return {};
-  return I->second;
+  for (const std::unique_ptr<BaseCommand> &Base : Opt.Commands)
+    if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base.get()))
+      if (Cmd->Name == Name)
+        return Cmd->Filler;
+  return {};
 }
 
 // Returns the index of the given section name in linker script
@@ -754,7 +755,7 @@
       return;
     }
     Tok = Tok.substr(3);
-    Opt.Filler[OutSec] = parseHex(Tok);
+    Cmd->Filler = parseHex(Tok);
     next();
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22615.64834.patch
Type: text/x-patch
Size: 1281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/131ba0ba/attachment.bin>


More information about the llvm-commits mailing list