Commit c71a79f618
src/link/Elf/Atom.zig
@@ -757,12 +757,13 @@ pub fn resolveRelocsAlloc(self: Atom, elf_file: *Elf, code: []u8) !void {
// Address of the dynamic thread pointer.
const DTP = @as(i64, @intCast(elf_file.dtpAddress()));
- relocs_log.debug(" {s}: {x}: [{x} => {x}] G({x}) ({s})", .{
+ relocs_log.debug(" {s}: {x}: [{x} => {x}] G({x}) ZG({x}) ({s})\n", .{
fmtRelocType(r_type),
r_offset,
P,
S + A,
G + GOT + A,
+ ZIG_GOT + A,
target.name(elf_file),
});
src/link/Elf.zig
@@ -770,6 +770,7 @@ pub fn initMetadata(self: *Elf) !void {
self.zig_rodata_section_index = try self.allocateAllocSection(.{
.name = ".zig.rodata",
.phdr_index = self.phdr_zig_load_ro_index.?,
+ .flags = elf.SHF_ALLOC | elf.SHF_WRITE, // TODO rename this section to .data.rel.ro
});
try self.last_atom_and_free_list_table.putNoClobber(gpa, self.zig_rodata_section_index.?, .{});
}