diff mbox series

[v2,2/3] powerpc: Discard dynsym section for !PPC32

Message ID 20181204005429.32681-3-joel@jms.id.au (mailing list archive)
State Superseded
Headers show
Series powerpc: Add to linker script discards | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked

Commit Message

Joel Stanley Dec. 4, 2018, 12:54 a.m. UTC
Alan Modra <amodra@gmail.com> explains:

 > Likely you could discard .interp > and .dynstr too, and .dynsym when
 > !CONFIG_PPC32.

Discarding of interp and dynstr happened in a previous patch. The dynsym
cleanup was a bit less straightforward, so it gets it's own patch.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
See https://lore.kernel.org/lkml/CACPK8Xft3n5KkpTjN3=7_VUCXHFcK7mxvZm2Rrqu7tppcBoyOg@mail.gmail.com/T/#m58532c86cf0c7b4fb01cc1fe724e48d4c7d8e4a7
---
 arch/powerpc/kernel/vmlinux.lds.S | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Segher Boessenkool Dec. 4, 2018, 5:40 p.m. UTC | #1
On Tue, Dec 04, 2018 at 11:24:28AM +1030, Joel Stanley wrote:
> Alan Modra <amodra@gmail.com> explains:
> 
>  > Likely you could discard .interp > and .dynstr too, and .dynsym when
>  > !CONFIG_PPC32.
> 
> Discarding of interp and dynstr happened in a previous patch. The dynsym
> cleanup was a bit less straightforward, so it gets it's own patch.

> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index 6570209b0671..2c93a420f456 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -266,14 +266,13 @@ SECTIONS
>  	}
>  #ifdef CONFIG_RELOCATABLE
>  	. = ALIGN(8);
> +#ifdef CONFIG_PPC32
>  	.dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET)
>  	{
> -#ifdef CONFIG_PPC32
>  		__dynamic_symtab = .;
> -#endif
>  		*(.dynsym)
>  	}
> -	.dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) }

So this last line belongs in the previous patch then, right?


Segher
Joel Stanley Dec. 10, 2018, 9:50 p.m. UTC | #2
On Wed, 5 Dec 2018 at 04:11, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> On Tue, Dec 04, 2018 at 11:24:28AM +1030, Joel Stanley wrote:
> > Alan Modra <amodra@gmail.com> explains:
> >
> >  > Likely you could discard .interp > and .dynstr too, and .dynsym when
> >  > !CONFIG_PPC32.
> >
> > Discarding of interp and dynstr happened in a previous patch. The dynsym
> > cleanup was a bit less straightforward, so it gets it's own patch.
>
> > diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> > index 6570209b0671..2c93a420f456 100644
> > --- a/arch/powerpc/kernel/vmlinux.lds.S
> > +++ b/arch/powerpc/kernel/vmlinux.lds.S
> > @@ -266,14 +266,13 @@ SECTIONS
> >       }
> >  #ifdef CONFIG_RELOCATABLE
> >       . = ALIGN(8);
> > +#ifdef CONFIG_PPC32
> >       .dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET)
> >       {
> > -#ifdef CONFIG_PPC32
> >               __dynamic_symtab = .;
> > -#endif
> >               *(.dynsym)
> >       }
> > -     .dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) }
>
> So this last line belongs in the previous patch then, right?

Correct. Good catch.
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 6570209b0671..2c93a420f456 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -266,14 +266,13 @@  SECTIONS
 	}
 #ifdef CONFIG_RELOCATABLE
 	. = ALIGN(8);
+#ifdef CONFIG_PPC32
 	.dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET)
 	{
-#ifdef CONFIG_PPC32
 		__dynamic_symtab = .;
-#endif
 		*(.dynsym)
 	}
-	.dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) }
+#endif
 	.dynamic : AT(ADDR(.dynamic) - LOAD_OFFSET)
 	{
 		__dynamic_start = .;
@@ -389,5 +388,8 @@  SECTIONS
 		*(.hash .gnu.hash)
 		*(.interp)
 		*(.dynstr)
+#ifndef CONFIG_PPC32
+		*(.dynsym)
+#endif
 	}
 }