summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2015-01-21 19:09:15 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2015-01-21 19:09:15 +0000
commit6978841146a402d9acc3df8ce89744084f38a3e4 (patch)
tree655ab5b81fde393fe1fb8202e4ccfc6a089eafa9 /sys/powerpc/aim
parentcfd22197a35711b1807a4d462e503b6c92899204 (diff)
downloadFreeBSD-src-6978841146a402d9acc3df8ce89744084f38a3e4.zip
FreeBSD-src-6978841146a402d9acc3df8ce89744084f38a3e4.tar.gz
Make sure to relocate tmpstk with everything else and avoid processing
non-relative relocations that the UART code makes for absent modules.
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/locore64.S8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S
index abce9d8..e1fcd3a 100644
--- a/sys/powerpc/aim/locore64.S
+++ b/sys/powerpc/aim/locore64.S
@@ -126,9 +126,14 @@ ASENTRY_NOPROF(__start)
ld %r1,0(%r2)
add %r2,%r1,%r2
+ /* Get load offset */
+ ld %r31,-0x8000(%r2) /* First TOC entry is TOC base */
+ subf %r31,%r31,%r2 /* Subtract from real TOC base to get base */
+
/* Set up the stack pointer */
ld %r1,TOC_REF(tmpstk)(%r2)
addi %r1,%r1,TMPSTKSZ-96
+ add %r1,%r1,%r31
/* Relocate kernel */
std %r3,48(%r1)
@@ -140,8 +145,7 @@ ASENTRY_NOPROF(__start)
1: mflr %r3
ld %r4,0(%r3)
add %r3,%r4,%r3
- ld %r4,-0x8000(%r2) /* First TOC entry is TOC base */
- subf %r4,%r4,%r2 /* Subtract from real TOC base to get base */
+ mr %r4,%r31
bl elf_reloc_self
nop
ld %r3,48(%r1)
OpenPOWER on IntegriCloud