[PATCH] [GNU] Implement --enable-new-dtags/--disable-new-dtags

Rui Ueyama ruiu at google.com
Sun Apr 5 19:38:56 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: include/lld/ReaderWriter/ELFLinkingContext.h:295
@@ -294,1 +294,3 @@
 
+  /// \brief Enable new dtags.
+  bool enableNewDtags() const { return _enableNewDtags; }
----------------
This is not a popular option, so please add more comments on this feature for readers of this code. We should mention that, if the flag is set, we emit DT_RUNPATH instead of DT_RPATH. They are functionally equivalent, but the former has lower precedence than the latter (in terms of other variables like LD_LIBRARY_PATH).

================
Comment at: include/lld/ReaderWriter/ELFLinkingContext.h:297
@@ +296,3 @@
+  bool enableNewDtags() const { return _enableNewDtags; }
+  void setEnableNewDtags(bool e) { _enableNewDtags = e; }
+
----------------
Both functions sound like setters of the variable. Maybe we should name the getter getEnableNewDTags? It's not consistent with the others, but in most places we use "get" for getters.

================
Comment at: lib/Driver/GnuLdDriver.cpp:629
@@ +628,3 @@
+    newdtags = false;
+  ctx->setEnableNewDtags(newdtags);
+
----------------
I prefer this

  if (parseArgs->hasArg(OPT_enable_newdtags))
    ctx->setEnableNewDtags(true);

http://reviews.llvm.org/D8836

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






More information about the llvm-commits mailing list