Skip to content

Commit f17670e

Browse files
dpgaoresistor
authored andcommitted
[ELF][RISCV] Handle R_RISCV_FUNC_RELATIVE in getImplicitAddend
Otherwise linking with --apply-dynamic-relocs (as is done by U-Boot, or due to -z rel which we don't support) when --check-dynamic-relocs is enabled (which is the default in assertions builds) will give an internal linker error when such a relocation is emitted. Fixes: 2d52aa8 ("[ELF][RISCV] Support R_RISCV_CHERI_CAPABILITY_CODE and R_RISCV_FUNC_RELATIVE")
1 parent a633851 commit f17670e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lld/ELF/Arch/RISCV.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ int64_t RISCV::getImplicitAddend(const uint8_t *buf, RelType type) const {
225225
return read64le(buf);
226226
case R_RISCV_RELATIVE:
227227
case R_RISCV_IRELATIVE:
228+
case R_RISCV_FUNC_RELATIVE:
228229
return ctx.arg.is64 ? read64le(buf) : read32le(buf);
229230
case R_RISCV_NONE:
230231
case R_RISCV_JUMP_SLOT:

0 commit comments

Comments
 (0)