adds first version of the expanded as assembler from mikko

This commit is contained in:
Torsten Ruger
2014-04-14 18:09:56 +03:00
parent 52e9542d73
commit 408b290b8a
32 changed files with 1943 additions and 1 deletions

View File

@ -0,0 +1,29 @@
module Elf
class StringTableSection < Section
def initialize(*args)
super
@string_data = "\x00"
@indices = {"" => 0}
end
def add_string(str)
return if @indices[str]
@indices[str] = @string_data.length
@string_data << str << "\x00"
end
def index_for(str)
@indices[str]
end
def write(io)
io << @string_data
end
def type
Elf::Constants::SHT_STRTAB
end
end
end