mirror of
https://github.com/ziglang/zig.git
synced 2025-12-26 08:03:08 +00:00
elf: make .zig.rodata writeable
This commit is contained in:
parent
17635e4f2a
commit
c71a79f618
@ -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.?, .{});
|
||||
}
|
||||
|
||||
@ -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),
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user