[lld] [ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs() (PR #120678)
Brad Smith via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 19:36:47 PST 2024
https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/120678
None
>From db6844e6964ada86de2559d0a0a6bd03334fa938 Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Thu, 19 Dec 2024 22:35:04 -0500
Subject: [PATCH] [ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs()
---
lld/ELF/Driver.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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) {
More information about the llvm-commits
mailing list