mbox series

[v2,mips-next,0/4] MIPS: vmlinux.lds.S sections fix & cleanup

Message ID 20210106200713.31840-1-alobakin@pm.me
Headers show
Series MIPS: vmlinux.lds.S sections fix & cleanup | expand

Message

Alexander Lobakin Jan. 6, 2021, 8:07 p.m. UTC
This series hunts the problems discovered after manual enabling of
ARCH_WANT_LD_ORPHAN_WARN, notably the missing PAGE_ALIGNED_DATA()
section affecting VDSO placement (marked for stable).

Compile and runtime tested on MIPS32R2 CPS board with no issues.

Since v1 [0]:
 - catch .got entries too as LLD may produce it (Nathan);
 - check for unwanted sections to be zero-sized instead of
   discarding (Fangrui).

[0] https://lore.kernel.org/linux-mips/20210104121729.46981-1-alobakin@pm.me

Alexander Lobakin (4):
  MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section
  MIPS: vmlinux.lds.S: add ".gnu.attributes" to DISCARDS
  MIPS: vmlinux.lds.S: catch bad .got, .plt and .rel.dyn at link time
  MIPS: select ARCH_WANT_LD_ORPHAN_WARN

 arch/mips/Kconfig              |  1 +
 arch/mips/kernel/vmlinux.lds.S | 39 +++++++++++++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)

Comments

Kees Cook Jan. 6, 2021, 10:07 p.m. UTC | #1
On Wed, Jan 06, 2021 at 08:08:46PM +0000, Alexander Lobakin wrote:
> Now, after that all the sections are explicitly described and
> declared in vmlinux.lds.S, we can enable ld orphan warnings to
> prevent from missing any new sections in future.
> 
> Signed-off-by: Alexander Lobakin <alobakin@pm.me>

Reviewed-by: Kees Cook <keescook@chromium.org>