Message ID | 20210107123428.354231-1-alobakin@pm.me |
---|---|
State | Superseded |
Headers | show |
Series | MIPS: vmlinux.lds.S sections fixes & cleanup | expand |
On Thu, Jan 07, 2021 at 12:34:47PM +0000, Alexander Lobakin wrote: > MIPS uses its own declaration of rwdata, and thus it should be kept > in sync with the asm-generic one. Currently PAGE_ALIGNED_DATA() is > missing from the linker script, which emits the following ld > warnings: > > mips-alpine-linux-musl-ld: warning: orphan section > `.data..page_aligned' from `arch/mips/kernel/vdso.o' being placed > in section `.data..page_aligned' > mips-alpine-linux-musl-ld: warning: orphan section > `.data..page_aligned' from `arch/mips/vdso/vdso-image.o' being placed > in section `.data..page_aligned' > > Add the necessary declaration, so the mentioned structures will be > placed in vmlinux as intended: > > ffffffff80630580 D __end_once > ffffffff80630580 D __start___dyndbg > ffffffff80630580 D __start_once > ffffffff80630580 D __stop___dyndbg > ffffffff80634000 d mips_vdso_data > ffffffff80638000 d vdso_data > ffffffff80638580 D _gp > ffffffff8063c000 T __init_begin > ffffffff8063c000 D _edata > ffffffff8063c000 T _sinittext > > -> > > ffffffff805a4000 D __end_init_task > ffffffff805a4000 D __nosave_begin > ffffffff805a4000 D __nosave_end > ffffffff805a4000 d mips_vdso_data > ffffffff805a8000 d vdso_data > ffffffff805ac000 D mmlist_lock > ffffffff805ac080 D tasklist_lock > > Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") > Cc: stable@vger.kernel.org # 4.4+ > Signed-off-by: Alexander Lobakin <alobakin@pm.me> > Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> > --- > arch/mips/kernel/vmlinux.lds.S | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S > index 5e97e9d02f98..83e27a181206 100644 > --- a/arch/mips/kernel/vmlinux.lds.S > +++ b/arch/mips/kernel/vmlinux.lds.S > @@ -90,6 +90,7 @@ SECTIONS > > INIT_TASK_DATA(THREAD_SIZE) > NOSAVE_DATA > + PAGE_ALIGNED_DATA(PAGE_SIZE) > CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) > READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) > DATA_DATA > -- > 2.30.0 > >
On Thu, Jan 07, 2021 at 12:34:53PM +0000, Alexander Lobakin wrote: > Discard GNU attributes (MIPS FP type, GNU Hash etc.) at link time > as kernel doesn't use it at all. > Solves a dozen of the following ld warnings (one per every file): > > mips-alpine-linux-musl-ld: warning: orphan section `.gnu.attributes' > from `arch/mips/kernel/head.o' being placed in section > `.gnu.attributes' > mips-alpine-linux-musl-ld: warning: orphan section `.gnu.attributes' > from `init/main.o' being placed in section `.gnu.attributes' > > Signed-off-by: Alexander Lobakin <alobakin@pm.me> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> > --- > arch/mips/kernel/vmlinux.lds.S | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S > index 83e27a181206..16468957cba2 100644 > --- a/arch/mips/kernel/vmlinux.lds.S > +++ b/arch/mips/kernel/vmlinux.lds.S > @@ -221,6 +221,7 @@ SECTIONS > /* ABI crap starts here */ > *(.MIPS.abiflags) > *(.MIPS.options) > + *(.gnu.attributes) > *(.options) > *(.pdr) > *(.reginfo) > -- > 2.30.0 > >
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 5e97e9d02f98..83e27a181206 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -90,6 +90,7 @@ SECTIONS INIT_TASK_DATA(THREAD_SIZE) NOSAVE_DATA + PAGE_ALIGNED_DATA(PAGE_SIZE) CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) DATA_DATA