Skip to content

Commit

Permalink
MIPS: vmlinux.lds.S: explicitly catch .rel.dyn symbols
Browse files Browse the repository at this point in the history
According to linker warnings, both GCC and LLVM generate '.rel.dyn'
symbols:

mips-alpine-linux-musl-ld: warning: orphan section `.rel.dyn'
from `init/main.o' being placed in section `.rel.dyn'

Link-time assertion shows that this section is sometimes empty,
sometimes not, depending on machine bitness and the compiler [0]:

  LD      .tmp_vmlinux.kallsyms1
mips64-linux-gnu-ld: Unexpected run-time relocations (.rel) detected!

Just use the ARM64 approach and declare it in vmlinux.lds.S closer
to __init_end.

[0] https://lore.kernel.org/linux-mips/20210109111259.GA4213@alpha.franken.de

Reported-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Alexander Lobakin authored and Thomas Bogendoerfer committed Jan 15, 2021
1 parent 894ef53 commit 008c3cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/mips/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ SECTIONS
PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
#endif

.rel.dyn : ALIGN(8) {
*(.rel)
*(.rel*)
}

#ifdef CONFIG_MIPS_ELF_APPENDED_DTB
.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
*(.appended_dtb)
Expand Down

0 comments on commit 008c3cb

Please sign in to comment.