[PATCH llvm 1/6] powerpc/toc: PowerPC64 future proof kernel toc, revised for lld

2021-12-20 Thread Alexey Kardashevskiy
From: Alan Modra This patch future-proofs the kernel against linker changes that might put the toc pointer at some location other than .got+0x8000, by replacing __toc_start+0x8000 with .TOC. throughout. If the kernel's idea of the toc pointer doesn't agree with the linker, bad things happen. pr

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-11 Thread Alexey Kardashevskiy
On 12/03/2021 10:32, Michael Ellerman wrote: Alan Modra writes: On Wed, Mar 10, 2021 at 01:44:57PM +0100, Christophe Leroy wrote: Le 10/03/2021 à 13:25, Alan Modra a écrit : On Wed, Mar 10, 2021 at 08:33:37PM +1100, Alexey Kardashevskiy wrote: One more question - the older version had a

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-11 Thread Michael Ellerman
Alan Modra writes: > On Wed, Mar 10, 2021 at 01:44:57PM +0100, Christophe Leroy wrote: >> >> Le 10/03/2021 à 13:25, Alan Modra a écrit : >> > On Wed, Mar 10, 2021 at 08:33:37PM +1100, Alexey Kardashevskiy wrote: >> > > One more question - the older version had a construct "DEFINED (.TOC.) ? >> >

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-10 Thread Alan Modra
On Wed, Mar 10, 2021 at 01:44:57PM +0100, Christophe Leroy wrote: > > > Le 10/03/2021 à 13:25, Alan Modra a écrit : > > On Wed, Mar 10, 2021 at 08:33:37PM +1100, Alexey Kardashevskiy wrote: > > > One more question - the older version had a construct "DEFINED (.TOC.) ? > > > .TOC. : ..." in case .

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-10 Thread Segher Boessenkool
On Wed, Mar 10, 2021 at 01:44:57PM +0100, Christophe Leroy wrote: > > > Le 10/03/2021 à 13:25, Alan Modra a écrit : > >On Wed, Mar 10, 2021 at 08:33:37PM +1100, Alexey Kardashevskiy wrote: > >>One more question - the older version had a construct "DEFINED (.TOC.) ? > >>.TOC. : ..." in case .TOC.

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-10 Thread Christophe Leroy
Le 10/03/2021 à 13:25, Alan Modra a écrit : On Wed, Mar 10, 2021 at 08:33:37PM +1100, Alexey Kardashevskiy wrote: One more question - the older version had a construct "DEFINED (.TOC.) ? .TOC. : ..." in case .TOC. is not defined (too old ld? too old gcc?) but the newer patch seems assuming it

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-10 Thread Alan Modra
On Wed, Mar 10, 2021 at 08:33:37PM +1100, Alexey Kardashevskiy wrote: > One more question - the older version had a construct "DEFINED (.TOC.) ? > .TOC. : ..." in case .TOC. is not defined (too old ld? too old gcc?) but the > newer patch seems assuming it is always defined, when was it added? I hav

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-10 Thread Alexey Kardashevskiy
One more question - the older version had a construct "DEFINED (.TOC.) ? .TOC. : ..." in case .TOC. is not defined (too old ld? too old gcc?) but the newer patch seems assuming it is always defined, when was it added? I have the same check in SLOF, for example, do I still need it? On 10/03/

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-10 Thread Alexey Kardashevskiy
On 10/03/2021 14:48, Alan Modra wrote: This patch future-proofs the kernel against linker changes that might put the toc pointer at some location other than .got+0x8000, by replacing __toc_start+0x8000 with .TOC. throughout. If the kernel's idea of the toc pointer doesn't agree with the linke

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-09 Thread Alan Modra
On Wed, Mar 10, 2021 at 03:44:44PM +1100, Alexey Kardashevskiy wrote: > For my own education, is .got for prom_init.o still generated by ld or gcc? .got is generated by ld. > In other words, should "objdump -D -s -j .got" ever dump .got for any .o > file, like below? No. "objdump -r prom_init.o

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-09 Thread Alan Modra
This patch future-proofs the kernel against linker changes that might put the toc pointer at some location other than .got+0x8000, by replacing __toc_start+0x8000 with .TOC. throughout. If the kernel's idea of the toc pointer doesn't agree with the linker, bad things happen. prom_init.c code relo