Skip to content

Commit 66cd37d

Browse files
committed
[ELF] Move PT_OPENBSD_WXNEEDED under osabi check like PT_OPENBSD_NOBTCFI
1 parent cc7d084 commit 66cd37d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lld/ELF/Config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ struct Config {
378378
uint8_t zStartStopVisibility;
379379
bool zText;
380380
bool zRetpolineplt;
381-
bool zWxneeded;
381+
bool zWxneeded = false;
382382
DiscardPolicy discard;
383383
GnuStackKind zGnustack;
384384
ICFLevel icf;

lld/ELF/Driver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,6 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
15031503
getZFlag(args, "start-stop-gc", "nostart-stop-gc", true);
15041504
ctx.arg.zStartStopVisibility = getZStartStopVisibility(ctx, args);
15051505
ctx.arg.zText = getZFlag(args, "text", "notext", true);
1506-
ctx.arg.zWxneeded = hasZOption(args, "wxneeded");
15071506
setUnresolvedSymbolPolicy(ctx, args);
15081507
ctx.arg.power10Stubs = args.getLastArgValue(OPT_power10_stubs_eq) != "no";
15091508

@@ -1898,8 +1897,10 @@ static void setConfigs(Ctx &ctx, opt::InputArgList &args) {
18981897
<< ": " << e.message();
18991898
}
19001899

1901-
if (ctx.arg.osabi == ELFOSABI_OPENBSD)
1900+
if (ctx.arg.osabi == ELFOSABI_OPENBSD) {
19021901
ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
1902+
ctx.arg.zWxneeded = hasZOption(args, "wxneeded");
1903+
}
19031904
}
19041905

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

0 commit comments

Comments
 (0)