From 1f4d0aaf08c117a0d6b56afd776066c336522f8b Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 10 Jul 2018 07:18:36 -0700 Subject: 4334 Fix CI. --- subx/020elf.cc | 18 ++++++++++++------ subx/021translate.cc | 5 +---- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'subx') diff --git a/subx/020elf.cc b/subx/020elf.cc index 18b52634..21d0d6bf 100644 --- a/subx/020elf.cc +++ b/subx/020elf.cc @@ -92,13 +92,19 @@ void load_segment_from_program_header(uint8_t* elf_contents, size_t size, uint32 End_of_program = p_vaddr+p_memsz; } +:(before "End Includes") +// Very primitive/fixed/insecure ELF segments for now. +// code: 0x08048000 -> 0x08048fff +// data: 0x08049000 -> 0x08049fff +// heap: 0x0804a000 -> 0x0804afff +// stack: 0x0804bfff -> 0x0804b000 (downward) +const int CODE_START = 0x08048000; +const int SEGMENT_SIZE = 0x1000; +const int DATA_START = 0x08049000; +const int AFTER_STACK = 0x0804c000; +:(code) void initialize_mem() { - // Very primitive/fixed/insecure ELF segments for now. - // code: 0x08048000 -> 0x08048fff - // data: 0x08049000 -> 0x08049fff - // heap: 0x0804a000 -> 0x0804afff - // stack: 0x0804bfff -> 0x0804b000 (downward) - Mem.resize(0x0804c000 - 0x08048000); + Mem.resize(AFTER_STACK - CODE_START); } inline uint32_t u32_in(uint8_t* p) { diff --git a/subx/021translate.cc b/subx/021translate.cc index 9ab33026..6d0fb899 100644 --- a/subx/021translate.cc +++ b/subx/021translate.cc @@ -12,9 +12,6 @@ typedef void (*transform_fn)(const string& input, string& output); :(before "End Globals") vector Transform; -:(before "End Includes") -const int CODE_START = 0x08048000; -const int CODE_SIZE = 0x1000; :(before "End Main") if (is_equal(argv[1], "translate")) { assert(argc > 3); @@ -109,7 +106,7 @@ void dump_elf_header(ostream& out) { emit(e_entry); // p_filesz uint32_t size = End_of_program - /*we're not using location 0*/1; - assert(size < CODE_SIZE); + assert(size < SEGMENT_SIZE); emit(size); // p_memsz emit(size); -- cgit 1.4.1-2-gfad0