1. 15 Jan, 2021 4 commits
    • Alexander Lobakin's avatar
      MIPS: properly stop .eh_frame generation · 894ef530
      Alexander Lobakin authored
      Commit 866b6a89 ("MIPS: Add DWARF unwinding to assembly") added
      -fno-asynchronous-unwind-tables to KBUILD_CFLAGS to prevent compiler
      from emitting .eh_frame symbols.
      However, as MIPS heavily uses CFI, that's not enough. Use the
      approach taken for x86 (as it also uses CFI) and explicitly put CFI
      symbols into the .debug_frame section (except for VDSO).
      This allows us to drop .eh_frame from DISCARDS as it's no longer
      being generated.
      
      Fixes: 866b6a89 ("MIPS: Add DWARF unwinding to assembly")
      Suggested-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      894ef530
    • Alexander Lobakin's avatar
      MIPS: vmlinux.lds.S: add ".gnu.attributes" to DISCARDS · 5629d418
      Alexander Lobakin authored
      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: default avatarAlexander Lobakin <alobakin@pm.me>
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      5629d418
    • Alexander Lobakin's avatar
      MIPS: CPS: don't create redundant .text.cps-vec section · ee90fef1
      Alexander Lobakin authored
      A number of symbols from arch/mips/kernel/cps-vec.S is explicitly
      placed into '.text.cps-vec' section.
      There are no direct references to this section, so there's no need
      to form it. '.balign 0x1000' directive will work anyway.
      
      Moreover, this section was being placed in vmlinux differently
      depending on CONFIG_LD_DEAD_CODE_DATA_ELIMINATION:
       - with this option enabled, '.text.cps-vec' was being caught
         by '.text.[0-9a-zA-Z_]*' from include/asm-generic/vmlinux.lds.h;
       - without this option, '.text.cps-vec' was being caught
         by discouraging '.text.*' from arch/mips/kernel/vmlinux.lds.S.
      
      '.text.*' should not be used in vmlinux linker scripts at all as it
      silently catches any orphan text sections.
      So, remove both '.section .text.cps-vec' and '.text.*' from cps-vec.S
      and vmlinux.lds.S respectively. As said, this does not affect related
      functions alignment:
      
      80116000 T mips_cps_core_entry
      80116028 t not_nmi
      80116200 T excep_tlbfill
      80116280 T excep_xtlbfill
      80116300 T excep_cache
      80116380 T excep_genex
      80116400 T excep_intex
      80116480 T excep_ejtag
      80116490 T mips_cps_core_init
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      ee90fef1
    • Alexander Lobakin's avatar
      MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section · 8ac7c87a
      Alexander Lobakin authored
      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: ebb5e78c ("MIPS: Initial implementation of a VDSO")
      Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Cc: stable@vger.kernel.org # 4.4+
      Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      8ac7c87a
  2. 13 Jan, 2021 5 commits
  3. 09 Jan, 2021 1 commit
  4. 07 Jan, 2021 7 commits
  5. 04 Jan, 2021 7 commits
  6. 28 Dec, 2020 3 commits
  7. 27 Dec, 2020 8 commits
  8. 26 Dec, 2020 5 commits