diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-10-12 17:57:35 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-10-12 17:57:35 -0700 |
| commit | c19dcafa17117475f8334d5186bd87fb56c9d315 (patch) | |
| tree | f7af587f9a1355c5229699d78876f7d1a84942a4 /src/link/Elf.zig | |
| parent | c0b2813e0468586faee5bf3ee7583afad53d771a (diff) | |
| parent | 2ab0c7391a871a3063f825e08e02ea2a8e9269e9 (diff) | |
| download | zig-c19dcafa17117475f8334d5186bd87fb56c9d315.tar.gz zig-c19dcafa17117475f8334d5186bd87fb56c9d315.zip | |
Merge remote-tracking branch 'origin/master' into llvm11
Diffstat (limited to 'src/link/Elf.zig')
| -rw-r--r-- | src/link/Elf.zig | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/link/Elf.zig b/src/link/Elf.zig index c62bb29f78..9c4029b3cd 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -1326,8 +1326,12 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { digest = man.final(); var prev_digest_buf: [digest.len]u8 = undefined; - const prev_digest: []u8 = directory.handle.readLink(id_symlink_basename, &prev_digest_buf) catch |err| blk: { - log.debug("ELF LLD new_digest={} readlink error: {}", .{ digest, @errorName(err) }); + const prev_digest: []u8 = Cache.readSmallFile( + directory.handle, + id_symlink_basename, + &prev_digest_buf, + ) catch |err| blk: { + log.debug("ELF LLD new_digest={} error: {}", .{ digest, @errorName(err) }); // Handle this as a cache miss. break :blk prev_digest_buf[0..0]; }; @@ -1647,10 +1651,10 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { } if (!self.base.options.disable_lld_caching) { - // Update the dangling symlink with the digest. If it fails we can continue; it only + // Update the file with the digest. If it fails we can continue; it only // means that the next invocation will have an unnecessary cache miss. - directory.handle.symLink(&digest, id_symlink_basename, .{}) catch |err| { - std.log.warn("failed to save linking hash digest symlink: {}", .{@errorName(err)}); + Cache.writeSmallFile(directory.handle, id_symlink_basename, &digest) catch |err| { + std.log.warn("failed to save linking hash digest file: {}", .{@errorName(err)}); }; // Again failure here only means an unnecessary cache miss. man.writeManifest() catch |err| { @@ -2588,7 +2592,7 @@ pub fn updateDeclExports( }, }; const stt_bits: u8 = @truncate(u4, decl_sym.st_info); - if (exp.link.sym_index) |i| { + if (exp.link.elf.sym_index) |i| { const sym = &self.global_symbols.items[i]; sym.* = .{ .st_name = try self.updateString(sym.st_name, exp.options.name), @@ -2613,7 +2617,7 @@ pub fn updateDeclExports( .st_size = decl_sym.st_size, }; - exp.link.sym_index = @intCast(u32, i); + exp.link.elf.sym_index = @intCast(u32, i); } } } |
