• Helge Deller's avatar
    LoongArch: Fix lockdep static memory detection · 68ffa230
    Helge Deller authored
    Since commit 0a6b58c5 ("lockdep: fix static memory detection even
    more") the lockdep code uses is_kernel_core_data(), is_kernel_rodata()
    and init_section_contains() to verify if a lock is located inside a
    kernel static data section.
    
    This change triggers a failure on LoongArch, for which the vmlinux.lds.S
    script misses to put the locks (as part of in the .data.rel symbols)
    into the Linux data section.
    
    This patch fixes the lockdep problem by moving *(.data.rel*) symbols
    into the kernel data section (from _sdata to _edata).
    
    Additionally, move other wrongly assigned symbols too:
    - altinstructions into the _initdata section,
    - PLT symbols behind the read-only section, and
    - *(.la_abs) into the data section.
    
    Cc: stable <stable@kernel.org> # v6.4+
    Fixes: 0a6b58c5 ("lockdep: fix static memory detection even more")
    Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarHelge Deller <deller@gmx.de>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    68ffa230
vmlinux.lds.S 2.94 KB