[Wisp-cvs] wisp/users/dig elf.py,1.18,1.19
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-12 13:12:02
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv19663 Modified Files: elf.py Log Message: better handling for .symtab Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- elf.py 12 Apr 2003 11:06:25 -0000 1.18 +++ elf.py 12 Apr 2003 13:11:58 -0000 1.19 @@ -439,6 +439,7 @@ '.rodata': 'r---', '.shstrtab': '---s', '.symstr': 'a--s', + '.symtab': 'a---', '.text': 'r-x-'}) def guess_ELF32_shflags (name): @@ -462,7 +463,6 @@ memory_bottom = 0x08048000, want_symbols = 0): # Will set given sections' origins. - sections = {} sections['.text'] = text sections['.data'] = data @@ -475,19 +475,17 @@ binary.place_symbol('#elf/flags', 0) # no flags for ia386 shentnames = ['.text', '.data'] - if want_symbols: shentnames += ['.symstr', '.symtab'] - shentnames.append('.shstrtab') - - sections['.shstrtab'] = Linkie('<') - sections['.shstrtab'].emit_byte(0) - if want_symbols: + shentnames += ['.symstr', '.symtab'] sections['.symstr'] = Linkie('<') sections['.symstr'].emit_byte(0) sections['.symtab'] = Linkie('<') sections['.symtab'].align(4) sections['.symtab'].emit_string('\0' * 16) + shentnames.append('.shstrtab') + sections['.shstrtab'] = Linkie('<') + sections['.shstrtab'].emit_byte(0) phentnames = [] for name in shentnames: @@ -520,7 +518,7 @@ address = memory_boundary | (offset & 0xFFF) # take into account alignments larger than a page address = (address + alignment - 1) & ~(alignment - 1) - binary.place_symbol('#' + name + '/p_flags', guess_ELF32_pflags(name)) + binary.place_symbol('#' + name + '/p_flags', p_flags) binary.place_symbol('#' + name + '/p_type', guess_ELF32_ptype(name)) section.set_origin(address) binary.place_symbol('&' + name, address) |