Skip to content

Commit 1b9805c

Browse files
authored
[ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs() (#120678)
1 parent e1833e3 commit 1b9805c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lld/ELF/Config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ struct Config {
363363
bool zInterpose;
364364
bool zKeepTextSectionPrefix;
365365
bool zLrodataAfterBss;
366-
bool zNoBtCfi = false;
366+
bool zNoBtCfi;
367367
bool zNodefaultlib;
368368
bool zNodelete;
369369
bool zNodlopen;

lld/ELF/Driver.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
14871487
args, "keep-text-section-prefix", "nokeep-text-section-prefix", false);
14881488
ctx.arg.zLrodataAfterBss =
14891489
getZFlag(args, "lrodata-after-bss", "nolrodata-after-bss", false);
1490+
ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
14901491
ctx.arg.zNodefaultlib = hasZOption(args, "nodefaultlib");
14911492
ctx.arg.zNodelete = hasZOption(args, "nodelete");
14921493
ctx.arg.zNodlopen = hasZOption(args, "nodlopen");
@@ -1897,9 +1898,6 @@ static void setConfigs(Ctx &ctx, opt::InputArgList &args) {
18971898
ErrAlways(ctx) << "cannot open --why-extract= file " << ctx.arg.whyExtract
18981899
<< ": " << e.message();
18991900
}
1900-
1901-
if (ctx.arg.osabi == ELFOSABI_OPENBSD)
1902-
ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
19031901
}
19041902

19051903
static bool isFormatBinary(Ctx &ctx, StringRef s) {

0 commit comments

Comments
 (0)