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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 23:02:43 PST 2024


================
@@ -1507,6 +1507,9 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
   setUnresolvedSymbolPolicy(ctx, args);
   ctx.arg.power10Stubs = args.getLastArgValue(OPT_power10_stubs_eq) != "no";
 
+  if (ctx.arg.osabi == ELFOSABI_OPENBSD)
----------------
MaskRay wrote:

osabi is not set here. It is first set by the OPT_m code below, then possibly inferred by input files or read from linker script OUTPUT_FORMAT.

It seems that we have to read it unconditionally here

https://github.com/llvm/llvm-project/pull/120678


More information about the llvm-commits mailing list