diff options
author | gkoehler <gkoehler@cvs.openbsd.org> | 2020-11-29 18:57:30 +0000 |
---|---|---|
committer | gkoehler <gkoehler@cvs.openbsd.org> | 2020-11-29 18:57:30 +0000 |
commit | 798bf7f575ad1757356fff0c6f5af5d62e114b78 (patch) | |
tree | 3a62cbb7390bd354815635ab9eb6b0c30429c192 /gnu | |
parent | 0f76b4922994be1cfa5e43a5927ebb2ae9a816d2 (diff) |
Teach lld to link the macppc kernel
Add R_PPC_ADDR24 to lld. We need R_PPC_ADDR24 for absolute branches
"ba" and "bla" in locore.S in the kernel.
In Makefile.macppc, add a gapdummy (like in Makefile.powerpc64) to
avoid an lld error. Also adapt a part of Makefile.i386, so my
powerpc64 can use clang and lld to build and link the macppc kernel.
(I didn't boot that kernel.)
My macppc can now build, link, and boot kernels with either ld.bfd or
ld.lld. Beware that kernels linked with ld.lld have at least one
problem (wrong &etext) not yet fixed.
ok kettenis@
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/llvm/lld/ELF/Arch/PPC.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gnu/llvm/lld/ELF/Arch/PPC.cpp b/gnu/llvm/lld/ELF/Arch/PPC.cpp index b3cc78710e9..4b959128759 100644 --- a/gnu/llvm/lld/ELF/Arch/PPC.cpp +++ b/gnu/llvm/lld/ELF/Arch/PPC.cpp @@ -220,6 +220,7 @@ RelExpr PPC::getRelExpr(RelType type, const Symbol &s, case R_PPC_ADDR16_HA: case R_PPC_ADDR16_HI: case R_PPC_ADDR16_LO: + case R_PPC_ADDR24: case R_PPC_ADDR32: return R_ABS; case R_PPC_DTPREL16: @@ -344,6 +345,7 @@ void PPC::relocateOne(uint8_t *loc, RelType type, uint64_t val) const { break; } case R_PPC_REL24: + case R_PPC_ADDR24: case R_PPC_LOCAL24PC: case R_PPC_PLTREL24: { uint32_t mask = 0x03FFFFFC; |