forked from OSchip/llvm-project
[ELF][PowerPC] Support R_PPC_COPY and R_PPC64_COPY
Reviewed By: Bdragon28, jhenderson, grimar, sfertile Differential Revision: https://reviews.llvm.org/D73255
This commit is contained in:
parent
0fca35c652
commit
f1dab29908
|
@ -140,6 +140,7 @@ void writePPC32GlinkSection(uint8_t *buf, size_t numEntries) {
|
|||
}
|
||||
|
||||
PPC::PPC() {
|
||||
copyRel = R_PPC_COPY;
|
||||
gotRel = R_PPC_GLOB_DAT;
|
||||
noneRel = R_PPC_NONE;
|
||||
pltRel = R_PPC_JMP_SLOT;
|
||||
|
|
|
@ -297,6 +297,7 @@ static uint32_t readFromHalf16(const uint8_t *loc) {
|
|||
}
|
||||
|
||||
PPC64::PPC64() {
|
||||
copyRel = R_PPC64_COPY;
|
||||
gotRel = R_PPC64_GLOB_DAT;
|
||||
noneRel = R_PPC64_NONE;
|
||||
pltRel = R_PPC64_JMP_SLOT;
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
# REQUIRES: ppc
|
||||
# RUN: llvm-mc -filetype=obj -triple=powerpc %p/Inputs/relocation-copy.s -o %t1.32.o
|
||||
# RUN: ld.lld -shared %t1.32.o -soname=so -o %t1.32.so
|
||||
# RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.32.o
|
||||
# RUN: ld.lld %t.32.o %t1.32.so -o %t.32
|
||||
# RUN: llvm-readobj -r %t.32 | FileCheck --check-prefix=REL32 %s
|
||||
# RUN: llvm-nm -S %t.32 | FileCheck --check-prefix=NM32 %s
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=powerpc64 %p/Inputs/relocation-copy.s -o %t1.64.o
|
||||
# RUN: ld.lld -shared %t1.64.o -soname=so -o %t1.64.so
|
||||
# RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.64.o
|
||||
# RUN: ld.lld %t.64.o %t1.64.so -o %t.64
|
||||
# RUN: llvm-readobj -r %t.64 | FileCheck --check-prefix=REL64 %s
|
||||
# RUN: llvm-nm -S %t.64 | FileCheck --check-prefix=NM64 %s
|
||||
|
||||
# REL32: .rela.dyn {
|
||||
# REL32-NEXT: 0x10030210 R_PPC_COPY x 0x0
|
||||
# REL32-NEXT: }
|
||||
|
||||
# NM32: 10030210 00000004 B x
|
||||
|
||||
# REL64: .rela.dyn {
|
||||
# REL64-NEXT: 0x10030350 R_PPC64_COPY x 0x0
|
||||
# REL64-NEXT: }
|
||||
|
||||
# NM64: 0000000010030350 0000000000000004 B x
|
||||
|
||||
lis 3, x@ha
|
||||
lwz 3, x@l(3)
|
|
@ -26,6 +26,7 @@
|
|||
#undef R_PPC64_GOT16_LO
|
||||
#undef R_PPC64_GOT16_HI
|
||||
#undef R_PPC64_GOT16_HA
|
||||
#undef R_PPC64_COPY
|
||||
#undef R_PPC64_GLOB_DAT
|
||||
#undef R_PPC64_JMP_SLOT
|
||||
#undef R_PPC64_RELATIVE
|
||||
|
@ -119,6 +120,7 @@ ELF_RELOC(R_PPC64_GOT16, 14)
|
|||
ELF_RELOC(R_PPC64_GOT16_LO, 15)
|
||||
ELF_RELOC(R_PPC64_GOT16_HI, 16)
|
||||
ELF_RELOC(R_PPC64_GOT16_HA, 17)
|
||||
ELF_RELOC(R_PPC64_COPY, 19)
|
||||
ELF_RELOC(R_PPC64_GLOB_DAT, 20)
|
||||
ELF_RELOC(R_PPC64_JMP_SLOT, 21)
|
||||
ELF_RELOC(R_PPC64_RELATIVE, 22)
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
# CHECK: Type: R_PPC64_GOT16_LO (15)
|
||||
# CHECK: Type: R_PPC64_GOT16_HI (16)
|
||||
# CHECK: Type: R_PPC64_GOT16_HA (17)
|
||||
# CHECK: Type: R_PPC64_COPY (19)
|
||||
# CHECK: Type: R_PPC64_GLOB_DAT (20)
|
||||
# CHECK: Type: R_PPC64_JMP_SLOT (21)
|
||||
# CHECK: Type: R_PPC64_RELATIVE (22)
|
||||
|
@ -143,6 +144,8 @@ Sections:
|
|||
Type: R_PPC64_GOT16_HI
|
||||
- Offset: 0x0000000000000000
|
||||
Type: R_PPC64_GOT16_HA
|
||||
- Offset: 0x0000000000000000
|
||||
Type: R_PPC64_COPY
|
||||
- Offset: 0x0000000000000000
|
||||
Type: R_PPC64_GLOB_DAT
|
||||
- Offset: 0x0000000000000000
|
||||
|
|
Loading…
Reference in New Issue