diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2021-03-05 00:37:25 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2021-03-17 19:59:13 +0100 |
| commit | dc34ac2b9e283ac4ca6c07ed9f4e201f860639d0 (patch) | |
| tree | b886a93da2fc27af0d67481608fd252456cde885 /src | |
| parent | 5d8944edc1361aeb36a55d8435ef1feecf714958 (diff) | |
| download | zig-dc34ac2b9e283ac4ca6c07ed9f4e201f860639d0.tar.gz zig-dc34ac2b9e283ac4ca6c07ed9f4e201f860639d0.zip | |
zld: fix incorrect offset calc for DICE
Diffstat (limited to 'src')
| -rw-r--r-- | src/link/MachO/Zld.zig | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/link/MachO/Zld.zig b/src/link/MachO/Zld.zig index 3714427e4e..ebddcebd26 100644 --- a/src/link/MachO/Zld.zig +++ b/src/link/MachO/Zld.zig @@ -2787,13 +2787,12 @@ fn writeDataInCode(self: *Zld) !void { .source_sect_id = object.text_section_index.?, }) orelse continue; - // TODO Currently assume that Dice will always be within the __TEXT,__text section. try buf.ensureCapacity( buf.items.len + object.data_in_code_entries.items.len * @sizeOf(macho.data_in_code_entry), ); for (object.data_in_code_entries.items) |dice| { const new_dice: macho.data_in_code_entry = .{ - .offset = text_sect.offset + target_mapping.offset + dice.offset - source_sect.offset, + .offset = text_sect.offset + target_mapping.offset + dice.offset, .length = dice.length, .kind = dice.kind, }; |
