Skip to content

Commit eb30c28

Browse files
andrewrkFri3dNstuff
authored andcommitted
remove "FIXME" from codebase
See ziglang#363. Please file issues rather than making TODO comments.
1 parent 06cc3c8 commit eb30c28

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

src/link/Dwarf.zig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ debug_str: StringSection,
2323
pub 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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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!
33073303
pub 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?
39183913
pub 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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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(.{

0 commit comments

Comments
 (0)