[ELF] Support R_PPC64_ADDR16_HIGH
authorFangrui Song <i@maskray.me>
Tue, 19 Jan 2021 19:42:52 +0000 (11:42 -0800)
committerFangrui Song <i@maskray.me>
Tue, 19 Jan 2021 19:42:53 +0000 (11:42 -0800)
commit5fcb412ed0831ad763810f9b424149b3b353451a
treee328eee5c87e4d4391d900fb252f90204f2d1ba7
parente12e0d66c03c89d8ff0b08a4285f5b74a85a5812
[ELF] Support R_PPC64_ADDR16_HIGH

R_PPC64_ADDR16_HI represents bits 16-31 of a 32-bit value
R_PPC64_ADDR16_HIGH represents bits 16-31 of a 64-bit value.

In the Linux kernel, `LOAD_REG_IMMEDIATE_SYM` defined in `arch/powerpc/include/asm/ppc_asm.h`
uses @l, @high, @higher, @highest to load the 64-bit value of a symbol.

Fixes https://github.com/ClangBuiltLinux/linux/issues/1260
lld/ELF/Arch/PPC64.cpp
lld/test/ELF/ppc64-reloc-addr.s
lld/test/ELF/ppc64-reloc-addr16-err.s