| ... | @@ -1690,7 +1690,11 @@ fn writeObjects(self: *Elf) !void { | ... | @@ -1690,7 +1690,11 @@ fn writeObjects(self: *Elf) !void { |
| 1690 | if (!atom_ptr.alive) continue; | 1690 | if (!atom_ptr.alive) continue; |
| 1691 | | 1691 | |
| 1692 | const shdr = &self.shdrs.items[atom_ptr.output_section_index]; | 1692 | const shdr = &self.shdrs.items[atom_ptr.output_section_index]; |
| | 1693 | if (shdr.sh_type == elf.SHT_NOBITS) continue; |
| | 1694 | if (shdr.sh_flags & elf.SHF_ALLOC == 0) continue; // TODO we don't yet know how to handle non-alloc sections |
| | 1695 | |
| 1693 | const file_offset = shdr.sh_offset + atom_ptr.value - shdr.sh_addr; | 1696 | const file_offset = shdr.sh_offset + atom_ptr.value - shdr.sh_addr; |
| | 1697 | log.debug("writing atom({d}) at 0x{x}", .{ atom_ptr.atom_index, file_offset }); |
| 1694 | const code = try atom_ptr.codeInObjectUncompressAlloc(self); | 1698 | const code = try atom_ptr.codeInObjectUncompressAlloc(self); |
| 1695 | defer gpa.free(code); | 1699 | defer gpa.free(code); |
| 1696 | | 1700 | |