Index: head/sys/conf/ldscript.powerpc =================================================================== --- head/sys/conf/ldscript.powerpc +++ head/sys/conf/ldscript.powerpc @@ -15,6 +15,7 @@ .text : { + *(.glink) *(.text) *(.stub) /* .gnu.warning sections are handled specially by elf32.em. */ @@ -71,6 +72,11 @@ } .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 @@ .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. */ Index: head/sys/conf/ldscript.powerpcspe =================================================================== --- head/sys/conf/ldscript.powerpcspe +++ head/sys/conf/ldscript.powerpcspe @@ -15,6 +15,7 @@ .text : { + *(.glink) *(.text) *(.stub) /* .gnu.warning sections are handled specially by elf32.em. */ @@ -72,6 +73,11 @@ } .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. @@ -88,10 +94,6 @@ .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. */ Index: head/sys/powerpc/aim/trap_subr32.S =================================================================== --- head/sys/powerpc/aim/trap_subr32.S +++ head/sys/powerpc/aim/trap_subr32.S @@ -302,10 +302,8 @@ */ .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 @@ 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 @@ 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 @@ 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):