| ... | ... | @@ -382,11 +382,12 @@ fn writeSyntheticSections(elf_file: *Elf) !void { |
| 382 | 382 | const SortRelocs = struct { |
| 383 | 383 | pub fn lessThan(ctx: void, lhs: elf.Elf64_Rela, rhs: elf.Elf64_Rela) bool { |
| 384 | 384 | _ = ctx; |
| 385 | assert(lhs.r_offset != rhs.r_offset); |
| 385 | 386 | return lhs.r_offset < rhs.r_offset; |
| 386 | 387 | } |
| 387 | 388 | }; |
| 388 | 389 | |
| 389 | | mem.sort(elf.Elf64_Rela, relocs.items, {}, SortRelocs.lessThan); |
| 390 | mem.sortUnstable(elf.Elf64_Rela, relocs.items, {}, SortRelocs.lessThan); |
| 390 | 391 | |
| 391 | 392 | log.debug("writing {s} from 0x{x} to 0x{x}", .{ |
| 392 | 393 | elf_file.getShString(shdr.sh_name), |