From 3b4dd68de5b4aa5876366a3cab5ebf4f2ca047a2 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 26 Nov 2021 11:51:45 -0800 Subject: [PATCH] [ELF][PPC64] Make --power10-stubs/--no-power10-stubs proper aliases for --power10-stubs={auto,no} This allows --power10-stubs= and --[no-]power10-stubs to override each other (they are position dependent in GNU ld). Also improve --help messages and the manpage. Note: GNU ld's default "auto" mode uses heuristics to decide whether Power10 instructions are used. Arguably it is a design mistake of R_PPC64_REL24_NOTOC (acked by the relevant folks on a libc-alpha discussion). We don't implement "auto", so the default --power10-stubs is the same as "yes". --- lld/ELF/Config.h | 2 +- lld/ELF/Driver.cpp | 16 +--------------- lld/ELF/Options.td | 17 +++++++---------- lld/ELF/Thunks.cpp | 8 ++++---- lld/docs/ld.lld.1 | 14 ++++++++++++++ lld/test/ELF/ppc64-pcrel-call-to-toc.s | 4 ++-- 6 files changed, 29 insertions(+), 32 deletions(-) diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h index aaeee4755bc3..c660a8e67c21 100644 --- a/lld/ELF/Config.h +++ b/lld/ELF/Config.h @@ -261,7 +261,7 @@ struct Configuration { UnresolvedPolicy unresolvedSymbols; UnresolvedPolicy unresolvedSymbolsInShlib; Target2Policy target2; - bool Power10Stub; + bool power10Stubs; ARMVFPArgKind armVFPArgs = ARMVFPArgKind::Default; BuildIdKind buildId = BuildIdKind::None; SeparateSegmentKind zSeparate; diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 5541a397c553..5d306eab022e 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -750,20 +750,6 @@ static OrphanHandlingPolicy getOrphanHandling(opt::InputArgList &args) { return OrphanHandlingPolicy::Place; } -// Parses --power10-stubs= flags, to disable or enable Power 10 -// instructions in stubs. -static bool getP10StubOpt(opt::InputArgList &args) { - - if (args.getLastArgValue(OPT_power10_stubs_eq)== "no") - return false; - - if (!args.hasArg(OPT_power10_stubs_eq) && - args.hasArg(OPT_no_power10_stubs)) - return false; - - return true; -} - // Parse --build-id or --build-id=