link.Elf: allow multiple relocs at the same location

RISC-V and LoongArch ELF psABIs define a kind of
RELAX relocations which are expected to have a normal
relocation at the same address.

Change-Id: I5737bfcfd3e5041fb6ab7d193c9fc57eeca1eec8
This commit is contained in:
Bingwu Zhang 2025-06-07 23:23:20 +08:00 committed by xtex
parent a38220376e
commit 2121450a90
No known key found for this signature in database
GPG key ID: B918086ED8045B91

View file

@ -366,7 +366,6 @@ fn writeSyntheticSections(elf_file: *Elf) !void {
const SortRelocs = struct {
pub fn lessThan(ctx: void, lhs: elf.Elf64_Rela, rhs: elf.Elf64_Rela) bool {
_ = ctx;
assert(lhs.r_offset != rhs.r_offset);
return lhs.r_offset < rhs.r_offset;
}
};