mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Codegen: 16-bit pointers
This commit is contained in:
parent
a5b76d2474
commit
a85452b2c2
@ -151,6 +151,10 @@ pub fn generateSymbol(
|
||||
const vaddr = bin_file.local_symbols.items[decl.link.local_sym_index].st_value;
|
||||
const endian = bin_file.base.options.target.cpu.arch.endian();
|
||||
switch (bin_file.base.options.target.cpu.arch.ptrBitWidth()) {
|
||||
16 => {
|
||||
try code.resize(2);
|
||||
mem.writeInt(u16, code.items[0..2], @intCast(u16, vaddr), endian);
|
||||
},
|
||||
32 => {
|
||||
try code.resize(4);
|
||||
mem.writeInt(u32, code.items[0..4], @intCast(u32, vaddr), endian);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user