[PATCH] ARM: replace branches to undefined weak functions with NOP

Denis Protivensky dprotivensky at accesssoftek.com
Wed Apr 8 00:07:49 PDT 2015


LGTM with nits.


REPOSITORY
  rL LLVM

================
Comment at: lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp:500
@@ +499,3 @@
+/// \brief Fixup unresolved weak reference with NOP instruction
+static bool fixupUnresolvedWeakReference(uint8_t *location,
+                                         Reference::KindValue kindValue) {
----------------
The name of the function should reflect that you only fixup call-like instructions.
`fixupUnresolvedWeakCall` sounds more correct.

================
Comment at: lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp:539
@@ +538,3 @@
+  if (!targetVAddress) {
+    bool result = fixupUnresolvedWeakReference(location, ref.kindValue());
+
----------------
You mix *unresolved* with *undefined* in this whole fragment of added code.
Please, be consistent. I think *unresolved* sounds better here.

================
Comment at: lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp:541
@@ +540,3 @@
+
+    if (result) {
+      DEBUG(llvm::dbgs() << "\t\tFixup undefined weak reference '";
----------------
`result` is a bad name for variable. Consider something having word `fixed` in it.

http://reviews.llvm.org/D8807

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list