Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-27 Thread Segher Boessenkool
Hi! On Sat, Aug 14, 2021 at 12:34:15PM -0700, Fāng-ruì Sòng wrote: > On Sat, Aug 14, 2021 at 5:59 AM Segher Boessenkool > wrote: > > > > On Fri, Aug 13, 2021 at 01:05:08PM -0700, Fangrui Song wrote: > > > Text relocations are considered very awful by linker developers. > > > > By very few linker

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-14 Thread Fāng-ruì Sòng
On Sat, Aug 14, 2021 at 5:59 AM Segher Boessenkool wrote: > > On Fri, Aug 13, 2021 at 01:05:08PM -0700, Fangrui Song wrote: > > Text relocations are considered very awful by linker developers. > > By very few linker developers. https://groups.google.com/g/generic-abi/c/Ckq19PfLxyk/m/uW29sgkoAgAJ

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-14 Thread Segher Boessenkool
On Fri, Aug 13, 2021 at 01:05:08PM -0700, Fangrui Song wrote: > Text relocations are considered very awful by linker developers. By very few linker developers. > binutils 2.35 added --enable-textrel-check={no,warn,error} > https://sourceware.org/bugzilla/show_bug.cgi?id=20824 Yes, some people wa

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-14 Thread Michael Ellerman
Bill Wendling writes: > On Fri, Aug 13, 2021 at 7:13 AM Daniel Axtens wrote: >> Bill Wendling writes: ... >> > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile >> > index 6505d66f1193..17a9fbf9b789 100644 >> > --- a/arch/powerpc/Makefile >> > +++ b/arch/powerpc/Makefile >> > @@ -122,6

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-14 Thread Segher Boessenkool
On Fri, Aug 13, 2021 at 11:59:21AM -0700, Nick Desaulniers wrote: > Or we can dig through why there are relocations in read only sections, > fix those, then enable `-z text` for all linkers. My recommendation > would be get the thing building, then go digging time permitting. It is not always a b

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-13 Thread Fangrui Song
On 2021-08-14, Daniel Axtens wrote: Bill Wendling writes: 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 -

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-13 Thread Nick Desaulniers
On Fri, Aug 13, 2021 at 11:24 AM Bill Wendling wrote: > > BTW, this patch should more properly be attributed to Fangrui Song. I > can send a follow-up patch that reflects this and adds more context to > the commit message. Sounds good to me. The TL;DR is that LLD has a different implicit default

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-13 Thread Bill Wendling
On Fri, Aug 13, 2021 at 7:13 AM Daniel Axtens wrote: > > Bill Wendling writes: > > > 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

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-13 Thread Daniel Axtens
Bill Wendling writes: > 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,not

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-12 Thread Nick Desaulniers
On Thu, Aug 12, 2021 at 1:49 PM Bill Wendling wrote: > > 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

[PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-12 Thread Bill Wendling
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 t