[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.
authorBrandon Bergren <bdragon@FreeBSD.org>
Thu, 7 May 2020 19:32:49 +0000 (19:32 +0000)
committerBrandon Bergren <bdragon@FreeBSD.org>
Thu, 7 May 2020 19:32:49 +0000 (19:32 +0000)
commit9411e24df3c518227a10206ce2bae2e2f05a901c
treeed809768c12b529cb0073b9a935c4a2d54cda5c4
parentf8519228d170730bac5dc3f95c38d044873d1ab2
[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.

This is a general cleanup of the relocatable kernel support on powerpc,
needed to enable kernel ifuncs.

 * Fix some relocatable issues in the kernel linker, and change to using
   a RELOCATABLE_KERNEL #define instead of #ifdef __powerpc__ for parts that
   other platforms can use in the future if they wish to have ET_DYN kernels.

 * Get rid of the DB_STOFFS hack now that the kernel is relocated to the DMAP
   properly across the board on powerpc64.

 * Add powerpc64 and powerpc32 ifunc functionality.

 * Allow AIM64 virtual mode OF kernels to run from the DMAP like other AIM64
   by implementing a virtual mode restart. This fixes the runtime address on
   PowerMac G5.

 * Fix symbol relocation problems on post-relocation kernels by relocating
   the symbol table.

 * Add an undocumented method for supplying kernel symbols on powernv and
   other powerpc machines using linux-style kernel/initrd loading -- If
   you pass the kernel in as the initrd as well, the copy resident in initrd
   will be used as a source for symbols when initializing the debugger.
   This method is subject to removal once we have a better way of doing this.

Approved by: jhibbits
Relnotes: yes
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D23156
13 files changed:
sys/conf/kern.pre.mk
sys/conf/ldscript.powerpc
sys/conf/ldscript.powerpc64
sys/conf/ldscript.powerpcspe
sys/kern/link_elf.c
sys/powerpc/aim/aim_machdep.c
sys/powerpc/aim/locore64.S
sys/powerpc/include/db_machdep.h
sys/powerpc/include/param.h
sys/powerpc/ofw/ofw_initrd.c
sys/powerpc/powerpc/elf32_machdep.c
sys/powerpc/powerpc/elf64_machdep.c
sys/powerpc/powerpc/machdep.c