stage2: move format-specific code to link.File.X

This makes the code outside of link.File.Elf less elf-specific and will
allow for easier implementation of other formats such as wasm.
This commit is contained in:
Isaac Freund
2020-08-02 12:16:03 +02:00
committed by Andrew Kelley
parent 5ae88e919b
commit 6123201f06
2 changed files with 144 additions and 197 deletions

View File

@@ -790,7 +790,7 @@ pub fn init(gpa: *Allocator, options: InitOptions) !Module {
errdefer gpa.free(root_name);
const bin_file_dir = options.bin_file_dir orelse std.fs.cwd();
const bin_file = try link.openBinFilePath(gpa, bin_file_dir, options.bin_file_path, .{
const bin_file = try link.File.openPath(gpa, bin_file_dir, options.bin_file_path, .{
.root_name = root_name,
.root_src_dir_path = options.root_pkg.root_src_dir_path,
.target = options.target,