mirror of
https://github.com/samsonjs/compiler.git
synced 2026-03-25 08:45:52 +00:00
26 lines
No EOL
586 B
Ruby
26 lines
No EOL
586 B
Ruby
|
|
### XXX development hack!
|
|
def stub_symtab!
|
|
text_segnum = 1
|
|
symtab_stub = {
|
|
:functions => [
|
|
# name type segnum addr
|
|
['_main', N_SECT | N_EXT, text_segunm, 0x0]
|
|
]
|
|
}
|
|
|
|
nlist_ary = []
|
|
stab = "\0"
|
|
strx = 1 # string index (1-based)
|
|
|
|
symtab[:functions].each do |name, type, segnum, addr|
|
|
nlist_ary << MachO::Nlist.new(strx, type, segnum, 0, addr)
|
|
stab << "#{name}\0"
|
|
strx += 1
|
|
end
|
|
symtab(nlist_ary, stab)
|
|
end
|
|
|
|
end
|
|
|
|
end |