Skip to content

Commit

Permalink
coff: parse and print linker directives
Browse files Browse the repository at this point in the history
kubkon committed Mar 19, 2024

Verified

This commit was signed with the committer’s verified signature.
domdfcoding Dominic Davis-Foster
1 parent 5f6dc15 commit d420d46
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Object.zig
Original file line number Diff line number Diff line change
@@ -408,8 +408,17 @@ fn printSectionHeader(self: *Object, writer: anytype, sect_id: u16, sect_hdr: *a
}

fn printDirectives(self: *Object, writer: anytype) !void {
_ = self;
_ = writer;
const sect = self.getSectionByName(".drectve") orelse return;
const data = self.data[sect.pointer_to_raw_data..][0..sect.size_of_raw_data];
try writer.writeAll(
\\ Linker Directives
\\ _________________
);
var it = std.mem.split(u8, data, " ");
while (it.next()) |dir| {
try writer.print(" {s}\n", .{dir});
}
try writer.writeByte('\n');
}

fn printRelocations(self: *Object, writer: anytype, sect_id: u16, sect_hdr: *align(1) const coff.SectionHeader) !void {

0 comments on commit d420d46

Please sign in to comment.