Skip to content

Commit

Permalink
[ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs() (#120678)
Browse files Browse the repository at this point in the history
  • Loading branch information
brad0 authored Dec 22, 2024
1 parent e1833e3 commit 1b9805c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lld/ELF/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ struct Config {
bool zInterpose;
bool zKeepTextSectionPrefix;
bool zLrodataAfterBss;
bool zNoBtCfi = false;
bool zNoBtCfi;
bool zNodefaultlib;
bool zNodelete;
bool zNodlopen;
Expand Down
4 changes: 1 addition & 3 deletions lld/ELF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
args, "keep-text-section-prefix", "nokeep-text-section-prefix", false);
ctx.arg.zLrodataAfterBss =
getZFlag(args, "lrodata-after-bss", "nolrodata-after-bss", false);
ctx.arg.zNoBtCfi = hasZOption(args, "nobtcfi");
ctx.arg.zNodefaultlib = hasZOption(args, "nodefaultlib");
ctx.arg.zNodelete = hasZOption(args, "nodelete");
ctx.arg.zNodlopen = hasZOption(args, "nodlopen");
Expand Down Expand Up @@ -1897,9 +1898,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) {
Expand Down

0 comments on commit 1b9805c

Please sign in to comment.