mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
remove "FIXME" from codebase
See #363. Please file issues rather than making TODO comments.
This commit is contained in:
parent
16180f525a
commit
6235cc3da4
@ -23,8 +23,6 @@ debug_str: StringSection,
|
||||
pub const UpdateError = error{
|
||||
/// Indicates the error is already reported on `failed_codegen` in the Zcu.
|
||||
CodegenFail,
|
||||
/// Indicates the error is already reported on `link_diags` in the Compilation.
|
||||
LinkFailure,
|
||||
OutOfMemory,
|
||||
};
|
||||
|
||||
@ -443,7 +441,6 @@ pub const Section = struct {
|
||||
const zo = elf_file.zigObjectPtr().?;
|
||||
const atom = zo.symbol(sec.index).atom(elf_file).?;
|
||||
if (atom.prevAtom(elf_file)) |_| {
|
||||
// FIXME:JK trimming/shrinking has to be reworked on ZigObject/Elf level
|
||||
atom.value += len;
|
||||
} else {
|
||||
const shdr = &elf_file.sections.items(.shdr)[atom.output_section_index];
|
||||
|
||||
@ -3127,9 +3127,6 @@ pub fn sortShdrs(
|
||||
fileLookup(files, ref.file, zig_object_ptr).?.atom(ref.index).?.output_section_index = atom_list.output_section_index;
|
||||
}
|
||||
if (shdr.sh_type == elf.SHT_RELA) {
|
||||
// FIXME:JK we should spin up .symtab potentially earlier, or set all non-dynamic RELA sections
|
||||
// to point at symtab
|
||||
// shdr.sh_link = backlinks[shdr.sh_link];
|
||||
shdr.sh_link = section_indexes.symtab.?;
|
||||
shdr.sh_info = backlinks[shdr.sh_info];
|
||||
}
|
||||
@ -3217,7 +3214,7 @@ fn updateSectionSizes(self: *Elf) !void {
|
||||
atom_list.dirty = false;
|
||||
}
|
||||
|
||||
// FIXME:JK this will hopefully not be needed once we create a link from Atom/Thunk to AtomList.
|
||||
// This might not be needed if there was a link from Atom/Thunk to AtomList.
|
||||
for (self.thunks.items) |*th| {
|
||||
th.value += slice.items(.atom_list_2)[th.output_section_index].value;
|
||||
}
|
||||
@ -3303,7 +3300,6 @@ fn updateSectionSizes(self: *Elf) !void {
|
||||
self.updateShStrtabSize();
|
||||
}
|
||||
|
||||
// FIXME:JK this is very much obsolete, remove!
|
||||
pub fn updateShStrtabSize(self: *Elf) void {
|
||||
if (self.section_indexes.shstrtab) |index| {
|
||||
self.sections.items(.shdr)[index].sh_size = self.shstrtab.items.len;
|
||||
@ -3914,7 +3910,6 @@ fn writeSyntheticSections(self: *Elf) !void {
|
||||
try self.writeShStrtab();
|
||||
}
|
||||
|
||||
// FIXME:JK again, why is this needed?
|
||||
pub fn writeShStrtab(self: *Elf) !void {
|
||||
if (self.section_indexes.shstrtab) |index| {
|
||||
const shdr = self.sections.items(.shdr)[index];
|
||||
|
||||
@ -58,7 +58,7 @@ pub fn allocate(list: *AtomList, elf_file: *Elf) !void {
|
||||
if (expand_section) last_atom_ref.* = list.lastAtom(elf_file).ref();
|
||||
shdr.sh_addralign = @max(shdr.sh_addralign, list.alignment.toByteUnits().?);
|
||||
|
||||
// FIXME:JK this currently ignores Thunks as valid chunks.
|
||||
// This currently ignores Thunks as valid chunks.
|
||||
{
|
||||
var idx: usize = 0;
|
||||
while (idx < list.atoms.keys().len) : (idx += 1) {
|
||||
@ -78,7 +78,8 @@ pub fn allocate(list: *AtomList, elf_file: *Elf) !void {
|
||||
placement_atom.next_atom_ref = list.firstAtom(elf_file).ref();
|
||||
}
|
||||
|
||||
// FIXME:JK if we had a link from Atom to parent AtomList we would not need to update Atom's value or osec index
|
||||
// If we had a link from Atom to parent AtomList we would not need to
|
||||
// update Atom's value or osec index.
|
||||
for (list.atoms.keys()) |ref| {
|
||||
const atom_ptr = elf_file.atom(ref).?;
|
||||
atom_ptr.output_section_index = list.output_section_index;
|
||||
|
||||
@ -1937,8 +1937,8 @@ pub fn allocateAtom(self: *ZigObject, atom_ptr: *Atom, requires_padding: bool, e
|
||||
const shdr = &slice.items(.shdr)[atom_ptr.output_section_index];
|
||||
const last_atom_ref = &slice.items(.last_atom)[atom_ptr.output_section_index];
|
||||
|
||||
// FIXME:JK this only works if this atom is the only atom in the output section
|
||||
// In every other case, we need to redo the prev/next links
|
||||
// This only works if this atom is the only atom in the output section. In
|
||||
// every other case, we need to redo the prev/next links.
|
||||
if (last_atom_ref.eql(atom_ptr.ref())) last_atom_ref.* = .{};
|
||||
|
||||
const alloc_res = try elf_file.allocateChunk(.{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user