From 672e0a7e5fe7ab7b5f1e454dbc61c1617867a7a9 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 30 Jun 2018 21:19:02 -0700 Subject: 4291 - stop copying the ELF header into memory No need for it once the program's loaded. And we keep programs from running the header as code. This also simplifies the header computation in the translator. --- subx/teensy/test5 | Bin 99 -> 99 bytes subx/teensy/test5.s | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'subx/teensy') diff --git a/subx/teensy/test5 b/subx/teensy/test5 index a67a5299..b960ac41 100755 Binary files a/subx/teensy/test5 and b/subx/teensy/test5 differ diff --git a/subx/teensy/test5.s b/subx/teensy/test5.s index 54a79846..e4bd0c7e 100644 --- a/subx/teensy/test5.s +++ b/subx/teensy/test5.s @@ -11,7 +11,7 @@ ehdr: ; Elf32_Ehdr dw 2 ; e_type dw 3 ; e_machine dd 1 ; e_version - dd _start ; e_entry + dd $$ ; e_entry dd phdr - $$ ; e_phoff dd 0 ; e_shoff dd 0 ; e_flags @@ -25,11 +25,11 @@ ehdrsize equ $ - ehdr phdr: ; Elf32_Phdr dd 1 ; p_type - dd 0 ; p_offset + dd _start - $$ ; p_offset dd $$ ; p_vaddr dd $$ ; p_paddr - dd filesize ; p_filesz - dd filesize ; p_memsz + dd codesize ; p_filesz + dd codesize ; p_memsz dd 5 ; p_flags dd 0x1000 ; p_align phdrsize equ $ - phdr @@ -43,4 +43,4 @@ _start: dd 0x00000001 ; imm32 operand int 0x80 -filesize equ $ - $$ +codesize equ $ - _start -- cgit 1.4.1-2-gfad0