most the relocation stuff is going

This commit is contained in:
Torsten Ruger
2014-04-21 21:38:39 +03:00
parent f724883691
commit 40a6437893
5 changed files with 54 additions and 47 deletions

View File

@ -4,6 +4,12 @@ class Asm::Arm::GeneratorLabel < Asm::LabelObject
def initialize(asm)
@asm = asm
end
def at pos
@position = pos
end
def length
0
end
def set!
@asm.add_object self
end

View File

@ -141,8 +141,8 @@ module Asm
io << packed[0,3]
elsif (arg.is_a?(Asm::LabelObject) or arg.is_a?(Asm::LabelRefNode))
#not yet tested/supported
arg = @ast_asm.object_for_label(arg.label, self) if arg.is_a?(Asm::LabelRefNode)
as.add_relocation(io.tell, arg, Asm::Arm::R_ARM_PC24, RelocHandler)
# arg = @ast_asm.object_for_label(arg.label, self) if arg.is_a?(Asm::LabelRefNode)
# as.add_relocation(io.tell, arg, Asm::Arm::R_ARM_PC24, RelocHandler)
#write 0 "for now" and let relocation happen
io << "\x00\x00\x00"
else