authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-12-03 14:04:59-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 15:11:35-08:00
log6235cc3da4d2c6ebf7fd31242e8d82d39f5c81cf
tree619bd40a601c199b19bbac7ba25fff93fac4d1d5
parent16180f525a966de10b6fc0822fea107baf1f24f6

remove "FIXME" from codebase

See #363. Please file issues rather than making TODO comments.

4 files changed, 6 insertions(+), 13 deletions(-)

src/link/Dwarf.zig-3
......@@ -23,8 +23,6 @@ debug_str: StringSection,
2323pub const UpdateError = error{
2424 /// Indicates the error is already reported on `failed_codegen` in the Zcu.
2525 CodegenFail,
26 /// Indicates the error is already reported on `link_diags` in the Compilation.
27 LinkFailure,
2826 OutOfMemory,
2927};
3028
......@@ -443,7 +441,6 @@ pub const Section = struct {
443441 const zo = elf_file.zigObjectPtr().?;
444442 const atom = zo.symbol(sec.index).atom(elf_file).?;
445443 if (atom.prevAtom(elf_file)) |_| {
446 // FIXME:JK trimming/shrinking has to be reworked on ZigObject/Elf level
447444 atom.value += len;
448445 } else {
449446 const shdr = &elf_file.sections.items(.shdr)[atom.output_section_index];
src/link/Elf.zig+1-6
......@@ -3127,9 +3127,6 @@ pub fn sortShdrs(
31273127 fileLookup(files, ref.file, zig_object_ptr).?.atom(ref.index).?.output_section_index = atom_list.output_section_index;
31283128 }
31293129 if (shdr.sh_type == elf.SHT_RELA) {
3130 // FIXME:JK we should spin up .symtab potentially earlier, or set all non-dynamic RELA sections
3131 // to point at symtab
3132 // shdr.sh_link = backlinks[shdr.sh_link];
31333130 shdr.sh_link = section_indexes.symtab.?;
31343131 shdr.sh_info = backlinks[shdr.sh_info];
31353132 }
......@@ -3217,7 +3214,7 @@ fn updateSectionSizes(self: *Elf) !void {
32173214 atom_list.dirty = false;
32183215 }
32193216
3220 // FIXME:JK this will hopefully not be needed once we create a link from Atom/Thunk to AtomList.
3217 // This might not be needed if there was a link from Atom/Thunk to AtomList.
32213218 for (self.thunks.items) |*th| {
32223219 th.value += slice.items(.atom_list_2)[th.output_section_index].value;
32233220 }
......@@ -3303,7 +3300,6 @@ fn updateSectionSizes(self: *Elf) !void {
33033300 self.updateShStrtabSize();
33043301}
33053302
3306// FIXME:JK this is very much obsolete, remove!
33073303pub fn updateShStrtabSize(self: *Elf) void {
33083304 if (self.section_indexes.shstrtab) |index| {
33093305 self.sections.items(.shdr)[index].sh_size = self.shstrtab.items.len;
......@@ -3914,7 +3910,6 @@ fn writeSyntheticSections(self: *Elf) !void {
39143910 try self.writeShStrtab();
39153911}
39163912
3917// FIXME:JK again, why is this needed?
39183913pub fn writeShStrtab(self: *Elf) !void {
39193914 if (self.section_indexes.shstrtab) |index| {
39203915 const shdr = self.sections.items(.shdr)[index];
src/link/Elf/AtomList.zig+3-2
......@@ -58,7 +58,7 @@ pub fn allocate(list: *AtomList, elf_file: *Elf) !void {
5858 if (expand_section) last_atom_ref.* = list.lastAtom(elf_file).ref();
5959 shdr.sh_addralign = @max(shdr.sh_addralign, list.alignment.toByteUnits().?);
6060
61 // FIXME:JK this currently ignores Thunks as valid chunks.
61 // This currently ignores Thunks as valid chunks.
6262 {
6363 var idx: usize = 0;
6464 while (idx < list.atoms.keys().len) : (idx += 1) {
......@@ -78,7 +78,8 @@ pub fn allocate(list: *AtomList, elf_file: *Elf) !void {
7878 placement_atom.next_atom_ref = list.firstAtom(elf_file).ref();
7979 }
8080
81 // FIXME:JK if we had a link from Atom to parent AtomList we would not need to update Atom's value or osec index
81 // If we had a link from Atom to parent AtomList we would not need to
82 // update Atom's value or osec index.
8283 for (list.atoms.keys()) |ref| {
8384 const atom_ptr = elf_file.atom(ref).?;
8485 atom_ptr.output_section_index = list.output_section_index;
src/link/Elf/ZigObject.zig+2-2
......@@ -1937,8 +1937,8 @@ pub fn allocateAtom(self: *ZigObject, atom_ptr: *Atom, requires_padding: bool, e
19371937 const shdr = &slice.items(.shdr)[atom_ptr.output_section_index];
19381938 const last_atom_ref = &slice.items(.last_atom)[atom_ptr.output_section_index];
19391939
1940 // FIXME:JK this only works if this atom is the only atom in the output section
1941 // In every other case, we need to redo the prev/next links
1940 // This only works if this atom is the only atom in the output section. In
1941 // every other case, we need to redo the prev/next links.
19421942 if (last_atom_ref.eql(atom_ptr.ref())) last_atom_ref.* = .{};
19431943
19441944 const alloc_res = try elf_file.allocateChunk(.{