commit 8fd16913bf463cda6edb0e53cfa582879afb86bb Author: Brandon Bergren Date: Tue Oct 22 19:15:48 2019 -0500 powerpc32 lld-built kernel fixes. diff --git a/sys/conf/ldscript.powerpc b/sys/conf/ldscript.powerpc index 3792d6ca031..ce8aae5c84b 100644 --- a/sys/conf/ldscript.powerpc +++ b/sys/conf/ldscript.powerpc @@ -15,6 +15,7 @@ SECTIONS .text : { + *(.glink) *(.text) *(.stub) /* .gnu.warning sections are handled specially by elf32.em. */ @@ -71,6 +72,11 @@ SECTIONS } .data1 : { *(.data1) } .got1 : { *(.got1) } + . = ALIGN(4096); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + + .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. @@ -87,10 +93,6 @@ SECTIONS .fixup : { *(.fixup) } PROVIDE (_FIXUP_END_ = .); PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S index 12d61e4609d..990d438b643 100644 --- a/sys/powerpc/aim/trap_subr32.S +++ b/sys/powerpc/aim/trap_subr32.S @@ -302,10 +302,8 @@ CNAME(restorebridgesize) = .-CNAME(restorebridge) */ .globl CNAME(rstcode), CNAME(rstcodeend) CNAME(rstcode): - bl 1f - .long cpu_reset -1: mflr %r31 - lwz %r31,0(%r31) + lwz %r31, TRAP_GENTRAP(0) + addi %r31, %r31, (cpu_reset - generictrap) mtlr %r31 blrl CNAME(rstcodeend): @@ -384,10 +382,8 @@ CNAME(alitrap): mtcr %r31 /* Jump to s_trap */ - bl 1f - .long s_trap -1: mflr %r31 - lwz %r31,0(%r31) + lwz %r31, TRAP_GENTRAP(0) + addi %r31, %r31, (s_trap - generictrap) mtlr %r31 blrl CNAME(aliend): @@ -652,10 +648,8 @@ CNAME(dsitrap): mflr %r28 /* save LR (SP already saved) */ /* Jump to disitrap */ - bl 4f - .long disitrap -4: mflr %r1 - lwz %r1,0(%r1) + lwz %r1, TRAP_GENTRAP(0) + addi %r1, %r1, (disitrap - generictrap) mtlr %r1 blrl CNAME(dsiend): @@ -929,10 +923,8 @@ CNAME(dblow): mflr %r28 /* save LR */ /* Jump to dbtrap */ - bl 2f - .long dbtrap -2: mflr %r1 - lwz %r1,0(%r1) + lwz %r1, TRAP_GENTRAP(0) + addi %r1, %r1, (dbtrap - generictrap) mtlr %r1 blrl CNAME(dbend):