[Wisp-cvs] wisp/users/dig makehello.py,1.12,1.13
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-02-25 20:28:37
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv16846 Modified Files: makehello.py Log Message: cosmetical fixes Index: makehello.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/makehello.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- makehello.py 23 Feb 2003 11:05:15 -0000 1.12 +++ makehello.py 25 Feb 2003 20:28:33 -0000 1.13 @@ -86,9 +86,9 @@ sections['.data'] = data symbols = {} - hello = Linkie('<') + binary = Linkie('<') memory_boundary = memory_bottom # must be at page boundary - hello.extend(make_ELF32_header('<')) + binary.extend(make_ELF32_header('<')) symbols['elf/type'] = ET.EXEC symbols['elf/machine'] = EM.I386 symbols['elf/flags'] = 0 # no flags for ia386 @@ -114,7 +114,7 @@ sections['.shstrtab'].emit_byte(0) program_header_table = make_ELF32_phtable('<', phentnames) - symbols['elf/phoff'] = hello.extend(program_header_table) + symbols['elf/phoff'] = binary.extend(program_header_table) symbols['elf/phnum'] = len(phentnames) for name in shentnames: @@ -125,14 +125,14 @@ if p_flags <> 0: symbols[name + '/p_align'] = 0x1000 - hello.align(min(alignment, 0x1000)) + binary.align(min(alignment, 0x1000)) else: # No program header entry => not loaded # thusly no larger alignment necessary. - hello.align(min(alignment, 4)) + binary.align(min(alignment, 4)) - hello.place_symbol(name) - offset = hello.filesz() + binary.place_symbol(name) + offset = binary.filesz() if p_flags <> 0: address = memory_boundary | (offset & 0xFFF) @@ -155,12 +155,12 @@ symbols[name + '/sh_entsize'] = 0 symbols[name + '/sh_flags'] = guess_shflags(name) - hello.from_array(section.get_file()) + binary.from_array(section.get_file()) if address <> None: for symbol, value in section.get_symbols(): symbols[symbol] = address + value for symbol, value in section.get_symbols(): - hello.place_symbol(symbol, offset + value) # for dump to work nicely + binary.place_symbol(symbol, offset + value) # for dump to work nicely sofs = sections['.symstr'].filesz() symbols['.symstr/strings/' + symbol] = sofs sections['.symstr'].emit_string(symbol) @@ -173,18 +173,18 @@ sections['.symtab'].emit_wyde(shentnames.index(name) + 1) for loc, typ, arg in section.get_notes(): - hello.notify_linker(offset + loc, typ, arg) + binary.notify_linker(offset + loc, typ, arg) memory_boundary += section.memsz() memory_boundary = (memory_boundary + 0xFFF) & ~0xFFF # create section header table section_header_table = make_ELF32_shtable('<', shentnames) - symbols['elf/shoff'] = hello.extend(section_header_table) + symbols['elf/shoff'] = binary.extend(section_header_table) symbols['elf/shnum'] = len(shentnames) + 1 symbols['elf/shstrndx'] = shentnames.index('.shstrtab') + 1 symbols['.symtab/sh_link'] = shentnames.index('.symstr') + 1 - hello.link(symbols) - return hello + binary.link(symbols) + return binary hello = make_executable(text = code, data = data) hello.dump() |