Skip to content

[ELF] Move PT_OPENBSD_NOBTCFI check to readConfigs() #120678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading