mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 21:10:27 +02:00
instead of our custom .go format, use elf
* libguile/objcodes.c: Change to expect objcode on disk to be embedded in ELF instead of having the funky cookie. (to_native_order): Use already existing SCM_BYTE_ORDER style byte order instead of chars. (bytecode_to_objcode): No need for word_size arg. (scm_bytecode_to_objcode, scm_objcode_to_bytecode): Take optional endianness arg instead of sometimes using target-endianness. (scm_load_objcode, scm_write_objcode, scm_bytecode_to_native_objcode): Remove. * libguile/objcodes.h: Adapt. * libguile/vm.c (scm_load_compiled_with_vm): Use scm_load_thunk_from_file. (make_boot_program): Adapt to use scm_bytecode_to_objcode with endianness arg. * module/Makefile.am (OBJCODE_LANG_SOURCES): Add (language objcode elf). * module/language/objcode/elf.scm: New module, embeds objcode in ELF. * module/language/bytecode/spec.scm (compile-objcode): (decompile-objcode): Use (target-endianness). * module/language/objcode/spec.scm: use (language objcode elf) for write-objcode. * module/scripts/disassemble.scm (disassemble): * module/system/repl/command.scm (disassemble-file): Use load-thunk-from-file. * module/system/vm/objcode.scm: Remove load-objcode and write-objcode. * test-suite/tests/asm-to-bytecode.test (test-target): Adapt to the new ELF world.
This commit is contained in:
parent
afc74c2920
commit
b8bc86bce1
12 changed files with 192 additions and 325 deletions
|
@ -1046,9 +1046,8 @@ SCM_DEFINE (scm_call_with_vm, "call-with-vm", 2, 0, 1,
|
|||
|
||||
SCM scm_load_compiled_with_vm (SCM file)
|
||||
{
|
||||
SCM program = scm_make_program (scm_load_objcode (file),
|
||||
SCM_BOOL_F, SCM_BOOL_F);
|
||||
|
||||
SCM program = scm_load_thunk_from_file (file);
|
||||
|
||||
return scm_c_vm_run (scm_the_vm (), program, NULL, 0);
|
||||
}
|
||||
|
||||
|
@ -1072,7 +1071,7 @@ make_boot_program (void)
|
|||
bp->metalen = 0;
|
||||
|
||||
u8vec = scm_c_take_gc_bytevector ((scm_t_int8*)bp, bp_size, SCM_BOOL_F);
|
||||
ret = scm_make_program (scm_bytecode_to_native_objcode (u8vec),
|
||||
ret = scm_make_program (scm_bytecode_to_objcode (u8vec, SCM_UNDEFINED),
|
||||
SCM_BOOL_F, SCM_BOOL_F);
|
||||
SCM_SET_CELL_WORD_0 (ret, (SCM_CELL_WORD_0 (ret) | SCM_F_PROGRAM_IS_BOOT));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue