diff --git a/lib/asm/arm_assembler.rb b/lib/asm/arm_assembler.rb index edd93183..db950a52 100644 --- a/lib/asm/arm_assembler.rb +++ b/lib/asm/arm_assembler.rb @@ -1,4 +1,3 @@ -require 'asm/arm_assembler' require 'asm/instruction' require 'asm/nodes' require 'stream_reader' diff --git a/lib/crystal.rb b/lib/crystal.rb index e69de29b..e604a2b1 100644 --- a/lib/crystal.rb +++ b/lib/crystal.rb @@ -0,0 +1,2 @@ +require "asm/arm_assembler" +require "elf/object_writer" diff --git a/lib/asm/object_writer.rb b/lib/elf/object_writer.rb similarity index 98% rename from lib/asm/object_writer.rb rename to lib/elf/object_writer.rb index 242bfa4d..70182c91 100644 --- a/lib/asm/object_writer.rb +++ b/lib/elf/object_writer.rb @@ -3,7 +3,7 @@ require 'elf/symbol_table_section' require 'elf/text_section' require 'elf/string_table_section' -module Asm +module Elf class ObjectWriter def initialize(target) diff --git a/test/helper.rb b/test/helper.rb index bf3b7e6c..d1184495 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -29,5 +29,3 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'test')) require 'crystal' -require 'asm/object_writer' -require "asm/arm_assembler" diff --git a/test/small_program_test.rb b/test/small_program_test.rb index 822d598f..3de94924 100644 --- a/test/small_program_test.rb +++ b/test/small_program_test.rb @@ -40,7 +40,7 @@ class TestSmallProg < MiniTest::Test #helper to write the file def write len ,name - writer = Asm::ObjectWriter.new(Elf::Constants::TARGET_ARM) + writer = Elf::ObjectWriter.new(Elf::Constants::TARGET_ARM) assembly = @generator.assemble_to_string assert_equal len * 4 , assembly.length writer.set_text assembly diff --git a/test/test_crystal.rb b/test/test_crystal.rb index dc2fc45f..5204c0e6 100644 --- a/test/test_crystal.rb +++ b/test/test_crystal.rb @@ -1,5 +1,4 @@ require_relative 'helper' -require "asm/arm_assembler" # try to test that the generation of basic instructions works # one instruction at a time, reverse testing from objdump --demangle -Sfghxp