Skip to content

[ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs() #120678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2024

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

@llvm/pr-subscribers-lld

Author: Brad Smith (brad0)

Changes

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

1 Files Affected:

  • (modified) lld/ELF/Driver.cpp (+3-3)
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index dfb17f9257c8f5..a925a714b810e2 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1507,6 +1507,9 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
   setUnresolvedSymbolPolicy(ctx, args);
   ctx.arg.power10Stubs = args.getLastArgValue(OPT_power10_stubs_eq) != "no";
 
+  if (ctx.arg.osabi == ELFOSABI_OPENBSD)
+    ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
+
   if (opt::Arg *arg = args.getLastArg(OPT_eb, OPT_el)) {
     if (arg->getOption().matches(OPT_eb))
       ctx.arg.optEB = true;
@@ -1897,9 +1900,6 @@ static void setConfigs(Ctx &ctx, opt::InputArgList &args) {
       ErrAlways(ctx) << "cannot open --why-extract= file " << ctx.arg.whyExtract
                      << ": " << e.message();
   }
-
-  if (ctx.arg.osabi == ELFOSABI_OPENBSD)
-    ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
 }
 
 static bool isFormatBinary(Ctx &ctx, StringRef s) {

@brad0 brad0 force-pushed the lld_openbsd_nobtcfi branch from db6844e to ea6808e Compare December 20, 2024 07:08
@brad0 brad0 requested a review from MaskRay December 20, 2024 07:40
@brad0 brad0 merged commit 1b9805c into llvm:main Dec 22, 2024
8 checks passed
@brad0 brad0 deleted the lld_openbsd_nobtcfi branch December 22, 2024 11:12
qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Feb 7, 2025
Local branch amd-gfx 0cab575 Merged main:9423961f259f into amd-gfx:4b57b2fc3a59
Remote branch main 1b9805c [ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs() (llvm#120678)
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.

3 participants