| ... | @@ -151,6 +151,10 @@ pub fn generateSymbol( | ... | @@ -151,6 +151,10 @@ pub fn generateSymbol( |
| 151 | const vaddr = bin_file.local_symbols.items[decl.link.local_sym_index].st_value; | 151 | const vaddr = bin_file.local_symbols.items[decl.link.local_sym_index].st_value; |
| 152 | const endian = bin_file.base.options.target.cpu.arch.endian(); | 152 | const endian = bin_file.base.options.target.cpu.arch.endian(); |
| 153 | switch (bin_file.base.options.target.cpu.arch.ptrBitWidth()) { | 153 | switch (bin_file.base.options.target.cpu.arch.ptrBitWidth()) { |
| | 154 | 16 => { |
| | 155 | try code.resize(2); |
| | 156 | mem.writeInt(u16, code.items[0..2], @intCast(u16, vaddr), endian); |
| | 157 | }, |
| 154 | 32 => { | 158 | 32 => { |
| 155 | try code.resize(4); | 159 | try code.resize(4); |
| 156 | mem.writeInt(u32, code.items[0..4], @intCast(u32, vaddr), endian); | 160 | mem.writeInt(u32, code.items[0..4], @intCast(u32, vaddr), endian); |