Skip to content

Conversation

@brad0
Copy link
Contributor

@brad0 brad0 commented Dec 20, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Dec 20, 2024

@llvm/pr-subscribers-lld-elf

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/120665.diff

2 Files Affected:

  • (modified) lld/ELF/Config.h (+1-1)
  • (modified) lld/ELF/Driver.cpp (+3-2)
diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h
index 48f0db6c214982..bf9df121c0378d 100644
--- a/lld/ELF/Config.h
+++ b/lld/ELF/Config.h
@@ -378,7 +378,7 @@ struct Config {
   uint8_t zStartStopVisibility;
   bool zText;
   bool zRetpolineplt;
-  bool zWxneeded;
+  bool zWxneeded = false;
   DiscardPolicy discard;
   GnuStackKind zGnustack;
   ICFLevel icf;
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index dfb17f9257c8f5..05e01b1a98331a 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1503,7 +1503,6 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
       getZFlag(args, "start-stop-gc", "nostart-stop-gc", true);
   ctx.arg.zStartStopVisibility = getZStartStopVisibility(ctx, args);
   ctx.arg.zText = getZFlag(args, "text", "notext", true);
-  ctx.arg.zWxneeded = hasZOption(args, "wxneeded");
   setUnresolvedSymbolPolicy(ctx, args);
   ctx.arg.power10Stubs = args.getLastArgValue(OPT_power10_stubs_eq) != "no";
 
@@ -1898,8 +1897,10 @@ static void setConfigs(Ctx &ctx, opt::InputArgList &args) {
                      << ": " << e.message();
   }
 
-  if (ctx.arg.osabi == ELFOSABI_OPENBSD)
+  if (ctx.arg.osabi == ELFOSABI_OPENBSD) {
     ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
+    ctx.arg.zWxneeded = hasZOption(args, "wxneeded");
+  }
 }
 
 static bool isFormatBinary(Ctx &ctx, StringRef s) {

@llvmbot
Copy link
Member

llvmbot commented Dec 20, 2024

@llvm/pr-subscribers-lld

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/120665.diff

2 Files Affected:

  • (modified) lld/ELF/Config.h (+1-1)
  • (modified) lld/ELF/Driver.cpp (+3-2)
diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h
index 48f0db6c214982..bf9df121c0378d 100644
--- a/lld/ELF/Config.h
+++ b/lld/ELF/Config.h
@@ -378,7 +378,7 @@ struct Config {
   uint8_t zStartStopVisibility;
   bool zText;
   bool zRetpolineplt;
-  bool zWxneeded;
+  bool zWxneeded = false;
   DiscardPolicy discard;
   GnuStackKind zGnustack;
   ICFLevel icf;
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index dfb17f9257c8f5..05e01b1a98331a 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1503,7 +1503,6 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
       getZFlag(args, "start-stop-gc", "nostart-stop-gc", true);
   ctx.arg.zStartStopVisibility = getZStartStopVisibility(ctx, args);
   ctx.arg.zText = getZFlag(args, "text", "notext", true);
-  ctx.arg.zWxneeded = hasZOption(args, "wxneeded");
   setUnresolvedSymbolPolicy(ctx, args);
   ctx.arg.power10Stubs = args.getLastArgValue(OPT_power10_stubs_eq) != "no";
 
@@ -1898,8 +1897,10 @@ static void setConfigs(Ctx &ctx, opt::InputArgList &args) {
                      << ": " << e.message();
   }
 
-  if (ctx.arg.osabi == ELFOSABI_OPENBSD)
+  if (ctx.arg.osabi == ELFOSABI_OPENBSD) {
     ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
+    ctx.arg.zWxneeded = hasZOption(args, "wxneeded");
+  }
 }
 
 static bool isFormatBinary(Ctx &ctx, StringRef s) {

@brad0 brad0 closed this Dec 20, 2024
@brad0 brad0 deleted the lld_openbsd_wxneeded branch December 22, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants