From: Bill Wendling <morbo@google.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com
Cc: Bill Wendling <morbo@google.com>
Subject: [PATCH] ppc: add "-z notext" flag to disable diagnostic
Date: Thu, 12 Aug 2021 13:49:51 -0700 [thread overview]
Message-ID: <20210812204951.1551782-1-morbo@google.com> (raw)
The "-z notext" flag disables reporting an error if DT_TEXTREL is set on
PPC with CONFIG=kdump:
ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 against
local symbol in readonly segment; recompile object files with -fPIC
or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in built-in.a(arch/powerpc/kernel/misc.o)
>>> referenced by arch/powerpc/kernel/misc.o:(.text+0x20) in archive
built-in.a
The BFD linker disables this by default (though it's configurable in
current versions). LLD enables this by default. So we add the flag to
keep LLD from emitting the error.
Signed-off-by: Bill Wendling <morbo@google.com>
---
The output of the "get_maintainer.pl" run just in case no one believes me. :-)
$ ./scripts/get_maintainer.pl arch/powerpc/Makefile
Michael Ellerman <mpe@ellerman.id.au> (supporter:LINUX FOR POWERPC (32-BIT AND 64-BIT))
Benjamin Herrenschmidt <benh@kernel.crashing.org> (reviewer:LINUX FOR POWERPC (32-BIT AND 64-BIT))
Paul Mackerras <paulus@samba.org> (reviewer:LINUX FOR POWERPC (32-BIT AND 64-BIT))
Nathan Chancellor <nathan@kernel.org> (supporter:CLANG/LLVM BUILD SUPPORT)
Nick Desaulniers <ndesaulniers@google.com> (supporter:CLANG/LLVM BUILD SUPPORT)
linuxppc-dev@lists.ozlabs.org (open list:LINUX FOR POWERPC (32-BIT AND 64-BIT))
linux-kernel@vger.kernel.org (open list)
clang-built-linux@googlegroups.com (open list:CLANG/LLVM BUILD SUPPORT)
---
arch/powerpc/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6505d66f1193..17a9fbf9b789 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -122,6 +122,7 @@ endif
LDFLAGS_vmlinux-y := -Bstatic
LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
+LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) += -z notext
LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y)
ifdef CONFIG_PPC64
--
2.33.0.rc1.237.g0d66db33f3-goog
next reply other threads:[~2021-08-12 20:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 20:49 Bill Wendling [this message]
2021-08-12 20:53 ` [PATCH] ppc: add "-z notext" flag to disable diagnostic Nick Desaulniers
2021-08-13 14:13 ` Daniel Axtens
2021-08-13 18:24 ` Bill Wendling
2021-08-13 18:59 ` Nick Desaulniers
2021-08-14 11:01 ` Segher Boessenkool
2021-08-14 11:59 ` Michael Ellerman
2021-08-13 20:05 ` Fangrui Song
2021-08-14 12:58 ` Segher Boessenkool
2021-08-14 19:34 ` Fāng-ruì Sòng
2021-08-27 14:40 ` Segher Boessenkool
2021-08-13 20:05 ` [PATCH v2] " Bill Wendling
2021-08-27 13:15 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210812204951.1551782-1-morbo@google.com \
--to=morbo@google.com \
--cc=benh@kernel.crashing.org \
--cc=clang-built-linux@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).