1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-05 00:57:08 +03:00

[ELF] Fix off-by-one error

This commit is contained in:
Rui Ueyama 2022-01-20 13:45:20 +09:00
parent 8b1905453d
commit 9c0a55a2eb

View File

@ -240,7 +240,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
i64 hi = 1 << 27;
i64 val = S + A - P;
if (val <= lo || hi <= val) {
if (val < lo || hi <= val) {
RangeExtensionRef ref = range_extn[i];
val = output_section->thunks[ref.thunk_idx]->get_addr(ref.sym_idx) + A - P;
assert(lo <= val && val < hi);