Skip to content

Commit db6844e

Browse files
committed
[ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs()
1 parent e93d226 commit db6844e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lld/ELF/Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,9 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
15071507
setUnresolvedSymbolPolicy(ctx, args);
15081508
ctx.arg.power10Stubs = args.getLastArgValue(OPT_power10_stubs_eq) != "no";
15091509

1510+
if (ctx.arg.osabi == ELFOSABI_OPENBSD)
1511+
ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
1512+
15101513
if (opt::Arg *arg = args.getLastArg(OPT_eb, OPT_el)) {
15111514
if (arg->getOption().matches(OPT_eb))
15121515
ctx.arg.optEB = true;
@@ -1897,9 +1900,6 @@ static void setConfigs(Ctx &ctx, opt::InputArgList &args) {
18971900
ErrAlways(ctx) << "cannot open --why-extract= file " << ctx.arg.whyExtract
18981901
<< ": " << e.message();
18991902
}
1900-
1901-
if (ctx.arg.osabi == ELFOSABI_OPENBSD)
1902-
ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
19031903
}
19041904

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

0 commit comments

Comments
 (0)