[PATCH] D13468: [ELF2] -z now option implemented

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 10:59:08 PDT 2015


ruiu added inline comments.

================
Comment at: ELF/Driver.cpp:143
@@ +142,3 @@
+    else {
+      warning(Twine("ignoring unknown argument for -z: ") + Opt);
+    }
----------------
grimar wrote:
> ruiu wrote:
> > Let's not warn on unknown options for now. They were silently ignored before this patch.
> Yes, I know they were. But this is equals to ld behavior now. It shows warnings on unknown -z options. But if you wish I will remove.
Ultimately we will want to warn on unknown options, but for now we ignore lots of options for ease of development, and I think -z is not an exception.

================
Comment at: ELF/OutputSections.cpp:319-324
@@ -316,2 +318,8 @@
 
+  uint32_t Flags = 0;
+  if (Config->Now)
+    Flags |= DF_1_NOW;
+  if (Flags)
+    WriteVal(DT_FLAGS_1, Flags);
+
   WriteVal(DT_NULL, 0);
----------------
grimar wrote:
> ruiu wrote:
> >   if (Config->Now)
> >     WriteVal(DT_FLAGS_1, DF_1_NOW);
> > 
> There are many possible -z options. And Flag is requred to combine them when at least one more will be added.
I'd want you to update the code to use a variable when you need the variable. Currently it can be written without that.


http://reviews.llvm.org/D13468





More information about the llvm-commits mailing list