From 0823672d94cd8d4ab551e0d6fd4b990b79e38b58 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sun, 22 Mar 2020 22:18:00 +0000 Subject: [PATCH] Fix linking OCTEON1 kernel with LLD LLD complains that the type of .dynamic was changed. Fix this by copying the approach used in the mips64 ldscript. I do not have hardware to test this change so I only verified that the kernel links and the section layout looks sensible. Reviewed By: imp, emaste Differential Revision: https://reviews.freebsd.org/D24093 --- sys/conf/ldscript.mips.octeon1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/conf/ldscript.mips.octeon1 b/sys/conf/ldscript.mips.octeon1 index b787fe97bba..598afc2da5b 100644 --- a/sys/conf/ldscript.mips.octeon1 +++ b/sys/conf/ldscript.mips.octeon1 @@ -10,8 +10,7 @@ SECTIONS { . = KERNLOADADDR + SIZEOF_HEADERS; .text : { - *(.text) - *(.dynamic) + *(.text) etext = .; _etext = .; . = ALIGN(0x2000); @@ -35,8 +34,10 @@ SECTIONS { *(.data) . = ALIGN(32); } - - _gp = (. + 0x8000); + .plt : { *(.plt) } + _gp = ALIGN(16) + 0x7ff0; + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } .sdata : { _small_start = .;