1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-13 09:39:13 +03:00

[ELF][RISC-V] Make calling an undefined weak symbol an infinite loop

This commit is contained in:
Rui Ueyama 2022-08-05 12:14:00 +08:00
parent 7177f7442b
commit a8345e83c5

View File

@ -294,7 +294,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
// Calling an undefined weak symbol does not make sense.
// We make such call into an infinite loop. This should
// help debugging of a faulty program.
*(ul32 *)loc = P;
*(ul32 *)loc = 0;
} else {
*(ul32 *)loc = S + A - P;
}