mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
macho: enable tracy in more places within the linker
This commit is contained in:
parent
31dcb0dde7
commit
054fe96bcd
@ -2579,6 +2579,9 @@ fn resolveDyldStubBinder(self: *MachO) !void {
|
||||
}
|
||||
|
||||
fn parseObjectsIntoAtoms(self: *MachO) !void {
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
var parsed_atoms = Object.ParsedAtoms.init(self.base.allocator);
|
||||
defer parsed_atoms.deinit();
|
||||
|
||||
@ -3933,6 +3936,9 @@ fn findFreeSpace(self: MachO, segment_id: u16, alignment: u64, start: ?u64) u64
|
||||
}
|
||||
|
||||
fn growSection(self: *MachO, match: MatchingSection, new_size: u32) !void {
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
const seg = &self.load_commands.items[match.seg].Segment;
|
||||
const sect = &seg.sections.items[match.sect];
|
||||
|
||||
@ -4081,6 +4087,9 @@ fn getSectionMaxAlignment(self: *MachO, segment_id: u16, start_sect_id: u16) !u3
|
||||
}
|
||||
|
||||
fn allocateAtom(self: *MachO, atom: *Atom, new_atom_size: u64, alignment: u64, match: MatchingSection) !u64 {
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
const seg = &self.load_commands.items[match.seg].Segment;
|
||||
const sect = &seg.sections.items[match.sect];
|
||||
var free_list = self.atom_free_lists.get(match).?;
|
||||
|
||||
@ -10,6 +10,7 @@ const macho = std.macho;
|
||||
const math = std.math;
|
||||
const mem = std.mem;
|
||||
const meta = std.meta;
|
||||
const trace = @import("../../tracy.zig").trace;
|
||||
|
||||
const Allocator = mem.Allocator;
|
||||
const Arch = std.Target.Cpu.Arch;
|
||||
@ -701,6 +702,9 @@ fn initRelocFromObject(rel: macho.relocation_info, context: RelocContext) !Reloc
|
||||
}
|
||||
|
||||
pub fn parseRelocs(self: *Atom, relocs: []macho.relocation_info, context: RelocContext) !void {
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
const filtered_relocs = filterRelocs(relocs, context.base_offset, context.base_offset + self.size);
|
||||
var it = RelocIterator{
|
||||
.buffer = filtered_relocs,
|
||||
@ -1141,6 +1145,9 @@ fn parseLoad(self: Atom, rel: macho.relocation_info, out: *Relocation) void {
|
||||
}
|
||||
|
||||
pub fn resolveRelocs(self: *Atom, macho_file: *MachO) !void {
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
for (self.relocs.items) |rel| {
|
||||
log.debug("relocating {}", .{rel});
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ const sort = std.sort;
|
||||
const commands = @import("commands.zig");
|
||||
const segmentName = commands.segmentName;
|
||||
const sectionName = commands.sectionName;
|
||||
const trace = @import("../../tracy.zig").trace;
|
||||
|
||||
const Allocator = mem.Allocator;
|
||||
const Atom = @import("Atom.zig");
|
||||
@ -344,6 +345,9 @@ const AtomParser = struct {
|
||||
pub fn next(self: *AtomParser, context: Context) !?*Atom {
|
||||
if (self.index == self.nlists.len) return null;
|
||||
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
var aliases = std.ArrayList(NlistWithIndex).init(context.allocator);
|
||||
defer aliases.deinit();
|
||||
|
||||
@ -465,6 +469,9 @@ pub fn parseIntoAtoms(
|
||||
object_id: u16,
|
||||
macho_file: *MachO,
|
||||
) !ParsedAtoms {
|
||||
const tracy = trace(@src());
|
||||
defer tracy.end();
|
||||
|
||||
var parsed_atoms = ParsedAtoms.init(allocator);
|
||||
const seg = self.load_commands.items[self.segment_cmd_index.?].Segment;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user