[PATCH] [ELF] Fix weak symbols order

Shankar Kalpathi Easwaran shankarke at gmail.com
Wed Mar 6 13:48:33 PST 2013


  will add the binary files too.


================
Comment at: lib/Passes/LayoutPass.cpp:162
@@ +161,3 @@
+            // atom into the chain
+            size_t currentAtomSize = (*ai).size();
+
----------------
Michael Spencer wrote:
>   .empty()
atom doesnot have empty() function.

================
Comment at: lib/Passes/LayoutPass.cpp:204-205
@@ +203,4 @@
+              _followOnNexts[ai] = targetAtom;
+            }
+            else {
+              _followOnNexts[ai] = _followOnRoots[targetAtom];
----------------
Michael Spencer wrote:
> No newline.
Ok.

================
Comment at: lib/Passes/LayoutPass.cpp:219-226
@@ -200,7 +218,10 @@
+                  break;
+              } // while true
+            } // end else (currentAtomSize != 0)
           }   // end else
         }     // else
       }       // kindLayoutAfter
     }         // Reference
   }           // range
 }
 
----------------
Michael Spencer wrote:
> This function is getting nested too deeply. It should probably be split into multiple functions.
Will take this in the upcoming patches.

================
Comment at: lib/ReaderWriter/ELF/File.h:464
@@ +463,3 @@
+        // reference to the anonymous atom that we created
+        if (((*si)->getBinding() == llvm::ELF::STB_WEAK) && (anonAtom)) {
+          ELFReference<ELFT> *wFollowedBy = new (_readerStorage)
----------------
Michael Spencer wrote:
> Drop the extra parens.
> 
>   if ((*si)->getBinding() == llvm::ELF::STB_WEAK && anonAtom)
ok.


http://llvm-reviews.chandlerc.com/D501



More information about the llvm-commits mailing list