Skip to content

Commit

Permalink
Merged main:3809f4ebabde into amd-gfx:a0d6dcabb5f7
Browse files Browse the repository at this point in the history
Local branch amd-gfx a0d6dca Merged main:3cbd476c5488 into amd-gfx:e39fa94175d0
Remote branch main 3809f4e [ELF] Support R_PPC_ADDR24 (ba foo; bla foo)
  • Loading branch information
Sw authored and Sw committed Jan 17, 2021
2 parents a0d6dca + 3809f4e commit 1a56045
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lld/ELF/Arch/PPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,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:
Expand Down Expand Up @@ -345,6 +346,7 @@ void PPC::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const {
write32(loc, (read32(loc) & ~mask) | (val & mask));
break;
}
case R_PPC_ADDR24:
case R_PPC_REL24:
case R_PPC_LOCAL24PC:
case R_PPC_PLTREL24: {
Expand Down
7 changes: 6 additions & 1 deletion lld/test/ELF/ppc32-reloc-addr.s
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
# CHECK-LABEL: section .R_PPC_ADDR16_LO:
# CHECK: addi 4, 4, 4660

.section .R_PPC_ADDR24,"ax",@progbits
ba a
# CHECK-LABEL: section .R_PPC_ADDR24:
# CHECK: ba 4660

.section .R_PPC_ADDR32,"a",@progbits
.long a
.long b
# HEX-LABEL: section .R_PPC_ADDR32:
# HEX-NEXT: 100000b4 00001234 000bcdef
# HEX-NEXT: {{.*}} 00001234 000bcdef
2 changes: 1 addition & 1 deletion llvm/include/llvm/Config/llvm-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/* Indicate that this is LLVM compiled from the amd-gfx branch. */
#define LLVM_HAVE_BRANCH_AMD_GFX
#define LLVM_MAIN_REVISION 377229
#define LLVM_MAIN_REVISION 377230

/* Define if LLVM_ENABLE_DUMP is enabled */
#cmakedefine LLVM_ENABLE_DUMP
Expand Down

0 comments on commit 1a56045

Please sign in to comment.