[PATCH] D22683: [ELF] Symbol assignment within input section list

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 12:45:30 PDT 2016


rafael added inline comments.

================
Comment at: ELF/LinkerScript.cpp:47
@@ +46,3 @@
+template <class ELFT>
+static inline Symbol *addSymbolToSymtabAux(StringRef Name, uint8_t StOther) {
+  return Symtab<ELFT>::X->addRegular(Name, STB_GLOBAL, StOther);
----------------
You don't need the inline.

================
Comment at: ELF/LinkerScript.cpp:52
@@ +51,3 @@
+template <class ELFT>
+static inline Symbol *addSymbolToSymtabAux(StringRef Name,
+                                           typename ELFT::uint Value,
----------------
Or here .

================
Comment at: ELF/LinkerScript.cpp:59
@@ +58,3 @@
+template <class ELFT, class... ArgsT>
+static void addSymbolToSymtab(SymbolAssignment *Cmd, ArgsT... Args) {
+  if (!Cmd || Cmd->Name == ".")
----------------
Cmd can be a reference.

================
Comment at: ELF/LinkerScript.cpp:204
@@ -167,3 +203,3 @@
 
-    if (OutputName == "/DISCARD/") {
-      for (InputSectionBase<ELFT> *S : Sections) {
+  auto Add = [&](StringRef OutputName, const InputSectionDescription *I) {
+    std::vector<InputSectionBase<ELFT> *> Sections;
----------------
Please keep the name Cmd instead of I.

================
Comment at: ELF/LinkerScript.cpp:206
@@ +205,3 @@
+    std::vector<InputSectionBase<ELFT> *> Sections;
+    for (InputSectionBase<ELFT> *S : getInputSections(I)) {
+      if (OutputName == "/DISCARD/") {
----------------
You are reverting Rui's patch in here. Please assign getInputSecitons to the Sections vector.


https://reviews.llvm.org/D22683





More information about the llvm-commits mailing list