Skip to content

Commit 006c681

Browse files
committed
[SOL] Add implicit addend for R_SBF_64_ABS32 relocations
1 parent 3a35203 commit 006c681

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lld/ELF/Arch/BPF.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ RelType BPF::getDynRel(RelType type) const {
7272
}
7373

7474
int64_t BPF::getImplicitAddend(const uint8_t *buf, RelType type) const {
75+
switch (type) {
76+
case R_BPF_64_ABS32:
77+
return SignExtend64<32>(read32le(buf));
78+
default:
79+
return 0;
80+
}
7581
return 0;
7682
}
7783

lld/ELF/Arch/SBF.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ RelType SBF::getDynRel(RelType type) const {
7272
}
7373

7474
int64_t SBF::getImplicitAddend(const uint8_t *buf, RelType type) const {
75+
switch (type) {
76+
case R_SBF_64_ABS32:
77+
return SignExtend64<32>(read32le(buf));
78+
default:
79+
return 0;
80+
}
7581
return 0;
7682
}
7783

0 commit comments

Comments
 (0)