wisp-cvs Mailing List for Wisp interpreter (Page 17)
Status: Alpha
Brought to you by:
digg
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(30) |
Sep
(312) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(5) |
Feb
(131) |
Mar
(17) |
Apr
(184) |
May
(252) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: <di...@us...> - 2003-04-14 01:57:55
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv20413 Modified Files: elf.py Log Message: converted emit_ELF32_symtab_entry into the ELF32_symtab class Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- elf.py 14 Apr 2003 01:38:44 -0000 1.34 +++ elf.py 14 Apr 2003 01:57:52 -0000 1.35 @@ -408,28 +408,33 @@ this.emit_byte(0) return ofs -# Returns index of the entry added. -def emit_ELF32_symtab_entry (symtab, symstr, pname, - value = None, section = SHN.ABS): - ofs = symstr.emit_entry(pname[1:]) - # No explicit alignment. .symtab doesn't bear padding; if - # you get it out of align, you're out of luck anyway. - i = symtab.memsz() / 16 - symtab.emit_tetra(ofs) - if value == None: symtab.emit_tetra_sum([pname]) - else: symtab.emit_tetra(value) - symtab.emit_tetra(0) # st_size - symtab.emit_byte(STB.GLOBAL << 4 | STT.NOTYPE) - symtab.emit_byte(0) # st_other; reserved - symtab.emit_wyde(section) - return i +class ELF32_symtab (Linkie): + def __init__ (this, byte_order, strtab): + Linkie.__init__(this, byte_order) + this._strtab = strtab + this.align(4) + this.emit_string('\0' * 16) + this._index = 0 # for pre-increment + # Returns index of the entry added. + def emit_entry (this, pname, value = None, section = SHN.ABS): + ofs = this._strtab.emit_entry(pname[1:]) + # No explicit alignment. .symtab doesn't bear padding; if + # you get it out of align, you're out of luck anyway. + this.emit_tetra(ofs) + if value == None: this.emit_tetra_sum([pname]) + else: this.emit_tetra(value) + this.emit_tetra(0) # st_size + this.emit_byte(STB.GLOBAL << 4 | STT.NOTYPE) + this.emit_byte(0) # st_other; reserved + this.emit_wyde(section) + this._index += 1 + return this._index # Note: all entries in a single relocation section # must either have or not have explicit addends. -def emit_ELF32_reloc_entry (rel, symtab, symstr, offset, type, pname, +def emit_ELF32_reloc_entry (rel, symtab, offset, type, pname, addend = None): - i = emit_ELF32_symtab_entry(symtab, symstr, pname, - value = 0, section = SHN.UNDEF) + i = symtab.emit_entry(pname, value = 0, section = SHN.UNDEF) # No explicit alignment. .rel* don't bear padding; if # you get it out of align, you're out of luck anyway. rel.emit_tetra(offset) @@ -516,9 +521,7 @@ if want_symbols or want_relocatable: shentnames += ['.symstr', '.symtab'] sections['.symstr'] = ELF32_strtab('<') - sections['.symtab'] = Linkie('<') - sections['.symtab'].align(4) - sections['.symtab'].emit_string('\0' * 16) + sections['.symtab'] = ELF32_symtab('<', sections['.symstr']) if want_relocatable: for s, sn in (text, '.text'), (data, '.data'): if s.note_count(): @@ -527,8 +530,7 @@ r.align(4) for ofs, typ, arg in s.get_notes(): if typ == 4: - emit_ELF32_reloc_entry(r, sections['.symtab'], - sections['.symstr'], ofs, + emit_ELF32_reloc_entry(r, sections['.symtab'], ofs, RELOC.I386.D32, arg) else: raise 'Unrepresentable relocation type', (ofs, typ, arg) @@ -603,8 +605,7 @@ symstr = sections['.symstr'] for symbol, value in section.get_symbols(): if symbol[0] == '&': # only process memory references - emit_ELF32_symtab_entry(symtab, symstr, symbol, value, - shentnames.index(name) + 1) + symtab.emit_entry(symbol, value, shentnames.index(name) + 1) memory_boundary += section.memsz() memory_boundary = (memory_boundary + 0xFFF) & ~0xFFF |
From: <di...@us...> - 2003-04-14 01:38:47
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv10320 Modified Files: elf.py Log Message: converted the ELF32_symstr class to a more generic ELF32_strtab class Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- elf.py 14 Apr 2003 01:33:12 -0000 1.33 +++ elf.py 14 Apr 2003 01:38:44 -0000 1.34 @@ -391,16 +391,18 @@ t.place_symbol('#elf/shnum', len(names) + 1) return t -class ELF32_symstr (Linkie): +class ELF32_strtab (Linkie): def __init__ (this, byte_order): Linkie.__init__(this, byte_order) this._emitted_symbols = {} + this.emit_byte(0) # Returns offset of the string added. # Avoids introducing duplicate entries. - def emit_entry (this, s): + def emit_entry (this, s, entry_label = None): if this._emitted_symbols.has_key(s): return this._emitted_symbols[s] ofs = this.memsz() + if entry_label <> None: this.place_symbol(entry_label, ofs) this._emitted_symbols[s] = ofs this.emit_string(s) this.emit_byte(0) @@ -513,9 +515,7 @@ shentnames = ['.text', '.data'] if want_symbols or want_relocatable: shentnames += ['.symstr', '.symtab'] - sections['.symstr'] = ELF32_symstr('<') - sections['.symstr'].emit_byte(0) - + sections['.symstr'] = ELF32_strtab('<') sections['.symtab'] = Linkie('<') sections['.symtab'].align(4) sections['.symtab'].emit_string('\0' * 16) @@ -534,8 +534,7 @@ raise 'Unrepresentable relocation type', (ofs, typ, arg) shentnames.append('.shstrtab') - sections['.shstrtab'] = Linkie('<') - sections['.shstrtab'].emit_byte(0) + sections['.shstrtab'] = ELF32_strtab('<') if not want_relocatable: phentnames = [] @@ -545,9 +544,7 @@ binary.paste(-4, make_ELF32_phtable('<', phentnames)) for name in shentnames: - sections['.shstrtab'].place_symbol('#.shstrtab/strings/' + name) - sections['.shstrtab'].emit_string(name) - sections['.shstrtab'].emit_byte(0) + sections['.shstrtab'].emit_entry(name, '#.shstrtab/strings/' + name) for name in shentnames: section = sections[name] |
From: <di...@us...> - 2003-04-14 01:33:16
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv7924 Modified Files: elf.py Log Message: avoid duplicate .symstr entries Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- elf.py 14 Apr 2003 01:19:56 -0000 1.32 +++ elf.py 14 Apr 2003 01:33:12 -0000 1.33 @@ -391,17 +391,25 @@ t.place_symbol('#elf/shnum', len(names) + 1) return t -# Returns offset of the string added -def emit_ELF32_symstr_entry (symstr, string): - ofs = symstr.memsz() - symstr.emit_string (string) - symstr.emit_byte(0) - return ofs +class ELF32_symstr (Linkie): + def __init__ (this, byte_order): + Linkie.__init__(this, byte_order) + this._emitted_symbols = {} + # Returns offset of the string added. + # Avoids introducing duplicate entries. + def emit_entry (this, s): + if this._emitted_symbols.has_key(s): + return this._emitted_symbols[s] + ofs = this.memsz() + this._emitted_symbols[s] = ofs + this.emit_string(s) + this.emit_byte(0) + return ofs # Returns index of the entry added. def emit_ELF32_symtab_entry (symtab, symstr, pname, value = None, section = SHN.ABS): - ofs = emit_ELF32_symstr_entry(symstr, pname[1:]) + ofs = symstr.emit_entry(pname[1:]) # No explicit alignment. .symtab doesn't bear padding; if # you get it out of align, you're out of luck anyway. i = symtab.memsz() / 16 @@ -505,7 +513,7 @@ shentnames = ['.text', '.data'] if want_symbols or want_relocatable: shentnames += ['.symstr', '.symtab'] - sections['.symstr'] = Linkie('<') + sections['.symstr'] = ELF32_symstr('<') sections['.symstr'].emit_byte(0) sections['.symtab'] = Linkie('<') |
From: <di...@us...> - 2003-04-14 01:19:59
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv1226 Modified Files: elf.py Log Message: first successful ELF32 relocatable object generated Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- elf.py 14 Apr 2003 00:59:32 -0000 1.31 +++ elf.py 14 Apr 2003 01:19:56 -0000 1.32 @@ -503,7 +503,7 @@ binary.place_symbol('#elf/flags', 0) # no flags for ia386 shentnames = ['.text', '.data'] - if want_symbols: + if want_symbols or want_relocatable: shentnames += ['.symstr', '.symtab'] sections['.symstr'] = Linkie('<') sections['.symstr'].emit_byte(0) @@ -512,14 +512,18 @@ sections['.symtab'].align(4) sections['.symtab'].emit_string('\0' * 16) if want_relocatable: - if text.note_count(): - shentnames.append('.rel.text') - sections['.rel.text'] = Linkie('<') - sections['.rel.text'].align(4) - if data.note_count(): - shentnames.append('.rel.data') - sections['.rel.data'] = Linkie('<') - sections['.rel.data'].align(4) + for s, sn in (text, '.text'), (data, '.data'): + if s.note_count(): + shentnames.append('.rel' + sn) + r = Linkie('<'); sections['.rel' + sn] = r + r.align(4) + for ofs, typ, arg in s.get_notes(): + if typ == 4: + emit_ELF32_reloc_entry(r, sections['.symtab'], + sections['.symstr'], ofs, + RELOC.I386.D32, arg) + else: + raise 'Unrepresentable relocation type', (ofs, typ, arg) shentnames.append('.shstrtab') sections['.shstrtab'] = Linkie('<') @@ -568,11 +572,22 @@ binary.place_symbol('#' + name + '/filesz', section.filesz()) binary.place_symbol('#' + name + '/sh_size', section.filesz()) binary.place_symbol('#' + name + '/sh_type', guess_ELF32_shtype(name)) - binary.place_symbol('#' + name + '/sh_info', 0) + if name[:5] == '.rela': + sh_info = shentnames.index(name[5:]) + 1 + elif name[:4] == '.rel': + sh_info = shentnames.index(name[4:]) + 1 + else: sh_info = 0 + binary.place_symbol('#' + name + '/sh_info', sh_info) if name == '.symtab': sh_link = shentnames.index('.symstr') + 1 + elif name[:4] == '.rel': # catches both .rela* and .rel* + sh_link = shentnames.index('.symtab') + 1 else: sh_link = SHN.UNDEF binary.place_symbol('#' + name + '/sh_link', sh_link) - binary.place_symbol('#' + name + '/sh_entsize', 0) + if name[:5] == '.rela': sh_entsize = 0xC + elif name[:4] == '.rel': sh_entsize = 0x8 + elif name == '.symtab': sh_entsize = 0x10 + else: sh_entsize = 0 + binary.place_symbol('#' + name + '/sh_entsize', sh_entsize) binary.place_symbol('#' + name + '/sh_flags', guess_ELF32_shflags(name)) # alignment has been processed already |
From: <di...@us...> - 2003-04-14 00:59:35
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv23362 Modified Files: elf.py Log Message: better attributes for relocation sections Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- elf.py 14 Apr 2003 00:52:39 -0000 1.30 +++ elf.py 14 Apr 2003 00:59:32 -0000 1.31 @@ -438,6 +438,8 @@ '.bss': SHT.NOBITS, '.dynstr': SHT.STRTAB, '.note': SHT.NOTE, + '.rel': SHT.REL, + '.rela': SHT.RELA, '.shstrtab': SHT.STRTAB, '.symstr': SHT.STRTAB, '.symtab': SHT.SYMTAB, @@ -451,6 +453,7 @@ return infer_by_prefix(name, {'': 'rw--', '.bss': 'rw--', '.comment': '----', + '.rel': '----', '.data': 'rw--', '.debug': '----', '.dynstr': 'a--s', |
From: <di...@us...> - 2003-04-14 00:52:43
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv18782 Modified Files: elf.py linkie.py Log Message: create linkies for relocation sections as needed when generating relocatable object files Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- elf.py 14 Apr 2003 00:44:40 -0000 1.29 +++ elf.py 14 Apr 2003 00:52:39 -0000 1.30 @@ -508,6 +508,16 @@ sections['.symtab'] = Linkie('<') sections['.symtab'].align(4) sections['.symtab'].emit_string('\0' * 16) + if want_relocatable: + if text.note_count(): + shentnames.append('.rel.text') + sections['.rel.text'] = Linkie('<') + sections['.rel.text'].align(4) + if data.note_count(): + shentnames.append('.rel.data') + sections['.rel.data'] = Linkie('<') + sections['.rel.data'].align(4) + shentnames.append('.shstrtab') sections['.shstrtab'] = Linkie('<') sections['.shstrtab'].emit_byte(0) Index: linkie.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- linkie.py 14 Apr 2003 00:21:58 -0000 1.23 +++ linkie.py 14 Apr 2003 00:52:40 -0000 1.24 @@ -225,6 +225,11 @@ Returns a list of the linker notes from the linkie.""" if this._unresolved_locals: raise 'Incomplete linkie', this return this._linker_notes[:] + def note_count (this): + """note_count() -> integer + Returns length of the linker note list of this linkie.""" + if this._unresolved_locals: raise 'Incomplete linkie', this + return len(this._linker_notes) def get_origin (this): return this._origin |
From: <di...@us...> - 2003-04-14 00:44:45
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv14641 Modified Files: elf.py Log Message: explicitly zero e_phoff in ELF headers of relocatable object files Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- elf.py 14 Apr 2003 00:40:23 -0000 1.28 +++ elf.py 14 Apr 2003 00:44:40 -0000 1.29 @@ -323,7 +323,7 @@ from linkie import Linkie -def make_ELF32_header (byte_order, zero_entry = 0): +def make_ELF32_header (byte_order, reloc = 0): h = Linkie(byte_order) h.align(4) h.emit_string('\x7F' + 'ELF') # magic @@ -339,9 +339,12 @@ h.emit_wyde_sum(['#elf/type']) h.emit_wyde_sum(['#elf/machine']) h.emit_tetra(EV.CURRENT) - if zero_entry: h.emit_tetra(0) - else: h.emit_tetra_sum(['&_start']) - h.emit_tetra_sum(['!elf/proghdr']) + if reloc: + h.emit_tetra(0) # no &_start + h.emit_tetra(0) # no !elf/proghdr + else: + h.emit_tetra_sum(['&_start']) + h.emit_tetra_sum(['!elf/proghdr']) h.emit_tetra_sum(['!elf/secthdr']) h.emit_tetra_sum(['#elf/flags']) h.emit_wyde(0x34) # e_ehsize @@ -488,7 +491,7 @@ binary = Linkie('<') memory_boundary = memory_bottom # must be at page boundary - binary.paste(0, make_ELF32_header('<', zero_entry = want_relocatable)) + binary.paste(0, make_ELF32_header('<', reloc = want_relocatable)) if want_relocatable: binary.place_symbol('#elf/type', ET.REL) else: |
From: <di...@us...> - 2003-04-14 00:40:26
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv12122 Modified Files: elf.py Log Message: explicitly zero entry point address in ELF headers of relocatable object files Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- elf.py 14 Apr 2003 00:32:18 -0000 1.27 +++ elf.py 14 Apr 2003 00:40:23 -0000 1.28 @@ -323,7 +323,7 @@ from linkie import Linkie -def make_ELF32_header (byte_order): +def make_ELF32_header (byte_order, zero_entry = 0): h = Linkie(byte_order) h.align(4) h.emit_string('\x7F' + 'ELF') # magic @@ -339,7 +339,8 @@ h.emit_wyde_sum(['#elf/type']) h.emit_wyde_sum(['#elf/machine']) h.emit_tetra(EV.CURRENT) - h.emit_tetra_sum(['&_start']) + if zero_entry: h.emit_tetra(0) + else: h.emit_tetra_sum(['&_start']) h.emit_tetra_sum(['!elf/proghdr']) h.emit_tetra_sum(['!elf/secthdr']) h.emit_tetra_sum(['#elf/flags']) @@ -487,7 +488,7 @@ binary = Linkie('<') memory_boundary = memory_bottom # must be at page boundary - binary.paste(0, make_ELF32_header('<')) + binary.paste(0, make_ELF32_header('<', zero_entry = want_relocatable)) if want_relocatable: binary.place_symbol('#elf/type', ET.REL) else: @@ -536,7 +537,7 @@ offset = binary.filesz() - if 'r' in flags or p_flags == 0: + if want_relocatable or p_flags == 0: section.set_origin(0) else: address = memory_boundary | (offset & 0xFFF) @@ -560,7 +561,7 @@ # alignment has been processed already binary.place_symbol('!' + name) - binary.paste(-1, section, skip_addr = 'r' in flags) + binary.paste(-1, section, skip_addr = want_relocatable) if want_symbols: symtab = sections['.symtab'] symstr = sections['.symstr'] @@ -574,7 +575,7 @@ # create section header table section_header_table = make_ELF32_shtable('<', shentnames, - zero_addresses = 'r' in flags) + zero_addresses = want_relocatable) binary.paste(-4, section_header_table) binary.place_symbol('#elf/shstrndx', shentnames.index('.shstrtab') + 1) binary.link() |
From: <di...@us...> - 2003-04-14 00:32:21
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv7759 Modified Files: elf.py Log Message: explicitly zero section addresses in section header tables of relocatable object files Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- elf.py 14 Apr 2003 00:26:36 -0000 1.26 +++ elf.py 14 Apr 2003 00:32:18 -0000 1.27 @@ -367,7 +367,7 @@ t.place_symbol('#elf/phnum', len(names)) return t -def make_ELF32_shtable (byte_order, names): +def make_ELF32_shtable (byte_order, names, zero_addresses = 0): t = Linkie(byte_order) t.align(4) t.place_symbol('!elf/secthdr') @@ -376,7 +376,8 @@ t.emit_tetra_sum(['#.shstrtab/strings/' + name]) t.emit_tetra_sum(['#' + name + '/sh_type']) t.emit_tetra_sum(['#' + name + '/sh_flags']) - t.emit_tetra_sum(['&' + name]) + if zero_addresses: t.emit_tetra(0) + else: t.emit_tetra_sum(['&' + name]) t.emit_tetra_sum(['!' + name]) t.emit_tetra_sum(['#' + name + '/sh_size']) t.emit_tetra_sum(['#' + name + '/sh_link']) @@ -572,7 +573,8 @@ memory_boundary = (memory_boundary + 0xFFF) & ~0xFFF # create section header table - section_header_table = make_ELF32_shtable('<', shentnames) + section_header_table = make_ELF32_shtable('<', shentnames, + zero_addresses = 'r' in flags) binary.paste(-4, section_header_table) binary.place_symbol('#elf/shstrndx', shentnames.index('.shstrtab') + 1) binary.link() |
From: <di...@us...> - 2003-04-14 00:26:38
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv4972 Modified Files: elf.py Log Message: don't add unrelocated addresses to the linkie when creating relocatable files Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- elf.py 14 Apr 2003 00:05:18 -0000 1.25 +++ elf.py 14 Apr 2003 00:26:36 -0000 1.26 @@ -559,7 +559,7 @@ # alignment has been processed already binary.place_symbol('!' + name) - binary.paste(-1, section) + binary.paste(-1, section, skip_addr = 'r' in flags) if want_symbols: symtab = sections['.symtab'] symstr = sections['.symstr'] |
From: <di...@us...> - 2003-04-14 00:22:03
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv2588 Modified Files: linkie.py Log Message: added the skip_addr argument to Linkie.paste Index: linkie.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- linkie.py 12 Apr 2003 11:10:51 -0000 1.22 +++ linkie.py 14 Apr 2003 00:21:58 -0000 1.23 @@ -258,7 +258,7 @@ for ofs, typ, arg in that._linker_notes: this._linker_notes.append((ofs + delta, typ, arg)) return delta - def paste (this, offset, that): + def paste (this, offset, that, skip_addr = 0): # Pastes /that/ into /this/ at specified /offset/ (if negative # /offset/ is treated as an alignment restriction and the actual # offset is automatically calculated from that). @@ -286,8 +286,10 @@ for sym, val in that._symbols: if sym[0] == '!': this._symbols.append((sym, val + thatofs)) - elif sym[0] in '#&': + elif sym[0] in '#': this._symbols.append((sym, val)) + elif sym[0] in '&': + if not skip_addr: this._symbols.append((sym, val)) else: raise 'unprefixed symbol', sym |
From: <di...@us...> - 2003-04-14 00:05:21
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv25579 Modified Files: Makefile.am elf.py Log Message: set section origins to 0 in relocatable files Index: Makefile.am =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 12 Apr 2003 11:17:57 -0000 1.8 +++ Makefile.am 14 Apr 2003 00:05:18 -0000 1.9 @@ -12,4 +12,4 @@ all: clean: clean-am - -rm -f *~ *.pyc *.pyo *.exe a.out hello hellowosym + -rm -f *.exe *.o *.pyc *.pyo *~ a.out hello hellowosym Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- elf.py 13 Apr 2003 23:40:56 -0000 1.24 +++ elf.py 14 Apr 2003 00:05:18 -0000 1.25 @@ -535,7 +535,9 @@ offset = binary.filesz() - if p_flags <> 0: + if 'r' in flags or p_flags == 0: + section.set_origin(0) + else: address = memory_boundary | (offset & 0xFFF) # take into account alignments larger than a page address = (address + alignment - 1) & ~(alignment - 1) @@ -543,8 +545,6 @@ binary.place_symbol('#' + name + '/p_type', guess_ELF32_ptype(name)) section.set_origin(address) binary.place_symbol('&' + name, address) - else: - address = None binary.place_symbol('#' + name + '/memsz', section.memsz()) binary.place_symbol('#' + name + '/filesz', section.filesz()) |
From: <di...@us...> - 2003-04-13 23:41:00
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv12932 Modified Files: elf.py makehello.py Log Message: declare relocatable files to be of type ET.REL Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- elf.py 13 Apr 2003 10:37:40 -0000 1.23 +++ elf.py 13 Apr 2003 23:40:56 -0000 1.24 @@ -487,7 +487,10 @@ binary = Linkie('<') memory_boundary = memory_bottom # must be at page boundary binary.paste(0, make_ELF32_header('<')) - binary.place_symbol('#elf/type', ET.EXEC) + if want_relocatable: + binary.place_symbol('#elf/type', ET.REL) + else: + binary.place_symbol('#elf/type', ET.EXEC) binary.place_symbol('#elf/machine', EM.I386) binary.place_symbol('#elf/flags', 0) # no flags for ia386 Index: makehello.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/makehello.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- makehello.py 13 Apr 2003 08:47:50 -0000 1.22 +++ makehello.py 13 Apr 2003 23:40:56 -0000 1.23 @@ -39,3 +39,11 @@ f = open('hellowosym', 'w') hellowosym.get_file().tofile(f) f.close() + +print 'Relocatable' +hellorel = make_ELF32_object(text = code, data = data, flags = 'rs') +hellorel.dump() + +f = open('hellorel.o', 'w') +hellorel.get_file().tofile(f) +f.close() |
From: <pi...@us...> - 2003-04-13 17:26:01
|
Update of /cvsroot/wisp/wisp/users/pisi In directory sc8-pr-cvs1:/tmp/cvs-serv18507 Added Files: whiptail.wisp Log Message: capture-alternate for whiptail --- NEW FILE: whiptail.wisp --- ;;; alternate pipe reader ;;; whiptail prints selected items to stderr ;;; and requires stdout to be a tty (in case i want to see anything, what i do) ;;; solution - make an alternate pipe reader ;;; should this be incorporated to unix.wim someday/somehow ? (use unix files syscalls semiraw-files) (define (make-pipe-close-hook pid) (lambda (port read? write?) (if (and read? write?) (begin (sys:close (file-descriptor port)) ; FIXME: the fd slot should be NULLed too. (sys:waitpid pid 0))))) (define (pipe-alternate-from proc (num 2)) (let* ((pipe (sys:pipe)) (child (sys:fork))) (if (zero? child) ; child (begin (sys:close (car pipe)) (sys:dup2 (cdr pipe) num) (sys:close (cdr pipe)) (dedicated proc)) ; parent (begin (sys:close (cdr pipe)) (my res (make-instance <old-file>) (init-input-file res (car pipe) (make-pipe-close-hook child)) res))))) (define (capture-alternate-lines proc num) (my p (pipe-alternate-from proc num) (hold (read-all-lines p) (close-input-port p)))) ;;; test (write (capture-alternate-lines "whiptail --noitem --separate-output --title Test --menu Select 20 20 10 tag1 item1 tag2 item2" 2)) (newline) (write (capture-alternate-lines "whiptail --noitem --separate-output --title Test --checklist checkbox 20 40 10 tag1 on tag2 on \"long tag1\" on \"long tag2\" on" 2)) (newline) |
From: <di...@us...> - 2003-04-13 10:37:43
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv20839 Modified Files: elf.py Log Message: no PHT in relocatable files Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- elf.py 13 Apr 2003 08:47:49 -0000 1.22 +++ elf.py 13 Apr 2003 10:37:40 -0000 1.23 @@ -478,6 +478,7 @@ def make_ELF32_object (text = None, data = None, flags = '', memory_bottom = 0x08048000): want_symbols = 's' in flags + want_relocatable = 'r' in flags # Will set given sections' origins. sections = {} sections['.text'] = text @@ -503,16 +504,17 @@ sections['.shstrtab'] = Linkie('<') sections['.shstrtab'].emit_byte(0) - phentnames = [] + if not want_relocatable: + phentnames = [] + for name in shentnames: + if guess_ELF32_pflags(name) <> 0: + phentnames.append(name) + binary.paste(-4, make_ELF32_phtable('<', phentnames)) + for name in shentnames: - if guess_ELF32_pflags(name) <> 0: - phentnames.append(name) sections['.shstrtab'].place_symbol('#.shstrtab/strings/' + name) sections['.shstrtab'].emit_string(name) sections['.shstrtab'].emit_byte(0) - - program_header_table = make_ELF32_phtable('<', phentnames) - binary.paste(-4, program_header_table) for name in shentnames: section = sections[name] |
From: <di...@us...> - 2003-04-13 08:47:56
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv24388 Modified Files: elf.py makehello.py tran.py Log Message: preparations for relocatable object generation Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- elf.py 12 Apr 2003 18:48:22 -0000 1.21 +++ elf.py 13 Apr 2003 08:47:49 -0000 1.22 @@ -393,11 +393,13 @@ symstr.emit_byte(0) return ofs +# Returns index of the entry added. def emit_ELF32_symtab_entry (symtab, symstr, pname, value = None, section = SHN.ABS): + ofs = emit_ELF32_symstr_entry(symstr, pname[1:]) # No explicit alignment. .symtab doesn't bear padding; if # you get it out of align, you're out of luck anyway. - ofs = emit_ELF32_symstr_entry (symstr, pname[1:]) + i = symtab.memsz() / 16 symtab.emit_tetra(ofs) if value == None: symtab.emit_tetra_sum([pname]) else: symtab.emit_tetra(value) @@ -405,14 +407,18 @@ symtab.emit_byte(STB.GLOBAL << 4 | STT.NOTYPE) symtab.emit_byte(0) # st_other; reserved symtab.emit_wyde(section) + return i # Note: all entries in a single relocation section # must either have or not have explicit addends. -def emit_ELF32_reloc_entry (rel, offset, type, symind, addend = None): - # No explicit alignment. .rel* doesn't bear padding; if +def emit_ELF32_reloc_entry (rel, symtab, symstr, offset, type, pname, + addend = None): + i = emit_ELF32_symtab_entry(symtab, symstr, pname, + value = 0, section = SHN.UNDEF) + # No explicit alignment. .rel* don't bear padding; if # you get it out of align, you're out of luck anyway. rel.emit_tetra(offset) - rel.emit_tetra((symind << 8) | type) + rel.emit_tetra((i << 8) | type) if addend <> None: rel.emit_tetra(addend) def infer_by_prefix (name, dict): @@ -469,9 +475,9 @@ if 'x' in flags: p_flags |= PF.X return p_flags -def make_ELF32_executable (text = None, data = None, - memory_bottom = 0x08048000, - want_symbols = 0): +def make_ELF32_object (text = None, data = None, flags = '', + memory_bottom = 0x08048000): + want_symbols = 's' in flags # Will set given sections' origins. sections = {} sections['.text'] = text Index: makehello.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/makehello.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- makehello.py 8 Apr 2003 22:24:02 -0000 1.21 +++ makehello.py 13 Apr 2003 08:47:50 -0000 1.22 @@ -25,7 +25,7 @@ data.emit_string('Hello, world!\n') print 'With symbols' -hello = make_ELF32_executable(text = code, data = data, want_symbols = 1) +hello = make_ELF32_object(text = code, data = data, flags = 's') hello.dump() f = open('hello', 'w') @@ -33,7 +33,7 @@ f.close() print 'Without symbols' -hellowosym = make_ELF32_executable(text = code, data = data, want_symbols = 0) +hellowosym = make_ELF32_object(text = code, data = data, flags = '') hellowosym.dump() f = open('hellowosym', 'w') Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tran.py 12 Apr 2003 17:46:24 -0000 1.2 +++ tran.py 13 Apr 2003 08:47:50 -0000 1.3 @@ -252,8 +252,7 @@ print 'DATA'; Data.dump() if Regstack: raise 'Regstack not empty after parsing ended', Regstack - binary = elf.make_ELF32_executable(text = Text, data = Data, - want_symbols = 1) + binary = elf.make_ELF32_object(text = Text, data = Data, flags = 's') f = open(output_name, 'w') binary.get_file().tofile(f) f.close() |
From: <di...@us...> - 2003-04-12 18:48:29
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv3165 Modified Files: elf.py Log Message: wrote emit_ELF32_reloc_entry Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- elf.py 12 Apr 2003 16:30:57 -0000 1.20 +++ elf.py 12 Apr 2003 18:48:22 -0000 1.21 @@ -406,6 +406,15 @@ symtab.emit_byte(0) # st_other; reserved symtab.emit_wyde(section) +# Note: all entries in a single relocation section +# must either have or not have explicit addends. +def emit_ELF32_reloc_entry (rel, offset, type, symind, addend = None): + # No explicit alignment. .rel* doesn't bear padding; if + # you get it out of align, you're out of luck anyway. + rel.emit_tetra(offset) + rel.emit_tetra((symind << 8) | type) + if addend <> None: rel.emit_tetra(addend) + def infer_by_prefix (name, dict): for l in range(len(name), -1, -1): prefix = name[:l] |
From: <di...@us...> - 2003-04-12 17:46:28
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv10219 Modified Files: tran.py Log Message: use getopt for command line parsing Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tran.py 12 Apr 2003 11:17:57 -0000 1.1 +++ tran.py 12 Apr 2003 17:46:24 -0000 1.2 @@ -10,12 +10,13 @@ from __future__ import generators +from getopt import getopt +from linkie import Linkie from shlex import shlex from types import * import elf import string import sys -from linkie import Linkie class Lexer (shlex): def __init__ (this, instream = None, infile = None): @@ -220,7 +221,6 @@ Macrostack = [] Registers = {Generic_Register: 'reg'} # for reverse translation -lex = Lexer(instream = open(sys.argv[1], 'r'), infile = sys.argv[1]) def get_token (): if Macrostack: @@ -238,13 +238,24 @@ State(tok) tok = get_token() -mainloop() -print 'TEXT'; Text.dump() -print 'DATA'; Data.dump() -if Regstack: - raise 'Regstack not empty after parsing ended', Regstack -binary = elf.make_ELF32_executable(text = Text, data = Data, want_symbols = 1) +def main (): + global lex + opts, args = getopt(sys.argv[1:], 'o:', ['output=']) + if len(args) != 1: + raise 'Invalid argument count -- must be 1', args + lex = Lexer(instream = open(args[0], 'r'), infile = args[0]) + output_name = 'a.out' + for opt, arg in opts: + if opt in ('-o', '--output'): output_name = arg + mainloop() + print 'TEXT'; Text.dump() + print 'DATA'; Data.dump() + if Regstack: + raise 'Regstack not empty after parsing ended', Regstack + binary = elf.make_ELF32_executable(text = Text, data = Data, + want_symbols = 1) + f = open(output_name, 'w') + binary.get_file().tofile(f) + f.close() -f = open('a.out', 'w') -binary.get_file().tofile(f) -f.close() +main() |
From: <di...@us...> - 2003-04-12 16:31:01
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv18234 Modified Files: elf.py Log Message: added guesswork entry for .dynsym Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- elf.py 12 Apr 2003 13:11:58 -0000 1.19 +++ elf.py 12 Apr 2003 16:30:57 -0000 1.20 @@ -434,10 +434,11 @@ '.data': 'rw--', '.debug': '----', '.dynstr': 'a--s', + '.dynsym': 'a---', '.line': '----', '.note': '----', '.rodata': 'r---', - '.shstrtab': '---s', + '.shstrtab': 'a--s', '.symstr': 'a--s', '.symtab': 'a---', '.text': 'r-x-'}) |
From: <di...@us...> - 2003-04-12 13:29:30
|
Update of /cvsroot/wisp/wisp/debian In directory sc8-pr-cvs1:/tmp/cvs-serv25099/debian Modified Files: postinst prerm Log Message: added debhelper tokens to postinst and prerm Index: postinst =================================================================== RCS file: /cvsroot/wisp/wisp/debian/postinst,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- postinst 7 Feb 2003 20:49:45 -0000 1.10 +++ postinst 12 Apr 2003 13:29:25 -0000 1.11 @@ -2,7 +2,7 @@ #### debian/postinst - Debian packaging of Wisp # -# Copyleft © 2002 by Andres Soolo (di...@us...) +# Copyleft © 2003 by Andres Soolo (di...@us...) # This file is licensed under the GNU GPL v2. If you # don't know what that means, please do read the GPL. # @@ -13,3 +13,5 @@ install-info --quiet --section "Programming" "" \ --description="The Wisp interpreter" \ /usr/share/info/wisp.info.gz + +#DEBHELPER# Index: prerm =================================================================== RCS file: /cvsroot/wisp/wisp/debian/prerm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- prerm 8 Aug 2002 16:44:09 -0000 1.10 +++ prerm 12 Apr 2003 13:29:25 -0000 1.11 @@ -2,7 +2,7 @@ #### debian/prerm - Debian packaging of Wisp # -# Copyleft © 2002 by Andres Soolo (di...@us...) +# Copyleft © 2003 by Andres Soolo (di...@us...) # This file is licensed under the GNU GPL v2. If you # don't know what that means, please do read the GPL. # @@ -15,3 +15,5 @@ fi install-info --quiet --remove /usr/share/info/wisp.info.gz + +#DEBHELPER# |
From: <di...@us...> - 2003-04-12 13:28:21
|
Update of /cvsroot/wisp/wisp/debian In directory sc8-pr-cvs1:/tmp/cvs-serv24722/debian Modified Files: rules Log Message: minor reformatting Index: rules =================================================================== RCS file: /cvsroot/wisp/wisp/debian/rules,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- rules 12 Apr 2003 12:34:29 -0000 1.11 +++ rules 12 Apr 2003 13:28:15 -0000 1.12 @@ -3,6 +3,7 @@ #### debian/rules - make(1) script to package Wisp for Debian # # Copyleft © 2002 by Andres Soolo (di...@us...) +# Copyleft © 2003 by Martin Paljak (pi...@us...) # This file is licensed under the GNU GPL v2. If you # don't know what that means, please do read the GPL. # @@ -24,7 +25,6 @@ -$(MAKE) -i distclean rm -f build - install: build dh_clean dh_installdirs @@ -32,29 +32,21 @@ mandir=$(CURDIR)/debian/tmp/usr/share/man \ infodir=$(CURDIR)/debian/tmp/usr/share/info \ install - binary: install dh_testdir dh_testroot dh_strip dh_installdocs - dh_installchangelogs + dh_installchangelogs dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol - dh_md5sums + dh_md5sums dh_builddeb - -.PHONY: binary clean install - - -# XXX - -.PHONY: copyright copyright: test -f debian/copyright || ( \ perl -npe 'exit if /full text of GPL/;' < COPYING \ @@ -65,3 +57,4 @@ echo \'/usr/share/common-licenses/GPL\'; \ ) >> debian/copyright ) +.PHONY: binary clean install copyright |
From: <di...@us...> - 2003-04-12 13:26:48
|
Update of /cvsroot/wisp/wisp/debian In directory sc8-pr-cvs1:/tmp/cvs-serv24232/debian Modified Files: control Log Message: Build-Depend on debhelper Index: control =================================================================== RCS file: /cvsroot/wisp/wisp/debian/control,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- control 12 Apr 2003 12:34:29 -0000 1.4 +++ control 12 Apr 2003 13:26:44 -0000 1.5 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Andres Soolo <di...@us...> Standards-Version: 3.5.8 -Build-Depends: libgc-dev, nasm, libgmp3-dev +Build-Depends: debhelper, libgc-dev, libgmp3-dev, nasm Package: wisp Architecture: i386 |
From: <di...@us...> - 2003-04-12 13:24:09
|
Update of /cvsroot/wisp/wisp In directory sc8-pr-cvs1:/tmp/cvs-serv23315 Modified Files: wisplint.wisp Log Message: added exceptions for debian/wisp.docs Index: wisplint.wisp =================================================================== RCS file: /cvsroot/wisp/wisp/wisplint.wisp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- wisplint.wisp 10 Mar 2003 15:39:49 -0000 1.26 +++ wisplint.wisp 12 Apr 2003 13:24:04 -0000 1.27 @@ -103,6 +103,7 @@ "config.sub" "debian/changelog" "debian/control" + "debian/wisp.docs" "doc/TODO" "doc/depends.txt" "doc/examples/embed.ewisp" @@ -142,6 +143,7 @@ "config.sub" "debian/changelog" "debian/control" + "debian/wisp.docs" "doc/TODO" "doc/depends.txt" "doc/examples/embed.ewisp" @@ -160,6 +162,7 @@ "NEWS" "debian/changelog" "debian/control" + "debian/wisp.docs" "doc/TODO" "doc/depends.txt" "doc/examples/quine.wisp" |
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) |
From: <pi...@us...> - 2003-04-12 12:34:32
|
Update of /cvsroot/wisp/wisp/debian In directory sc8-pr-cvs1:/tmp/cvs-serv8936 Modified Files: .cvsignore Makefile.am changelog control rules Added Files: wisp.docs Log Message: updated debian support --- NEW FILE: wisp.docs --- DISCLAIMER NEWS README Index: .cvsignore =================================================================== RCS file: /cvsroot/wisp/wisp/debian/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 22 Jul 2002 14:36:47 -0000 1.2 +++ .cvsignore 12 Apr 2003 12:34:29 -0000 1.3 @@ -3,3 +3,4 @@ files substvars tmp +copyright Index: Makefile.am =================================================================== RCS file: /cvsroot/wisp/wisp/debian/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 30 Jul 2002 21:43:59 -0000 1.6 +++ Makefile.am 12 Apr 2003 12:34:29 -0000 1.7 @@ -6,4 +6,4 @@ # #### @(#) $Id$ -EXTRA_DIST = changelog control postinst prerm rules .cvsignore +EXTRA_DIST = wisp.docs changelog control postinst prerm rules .cvsignore Index: changelog =================================================================== RCS file: /cvsroot/wisp/wisp/debian/changelog,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- changelog 10 May 2002 07:24:38 -0000 1.3 +++ changelog 12 Apr 2003 12:34:29 -0000 1.4 @@ -1,3 +1,12 @@ +wisp (0.9.9-1) unstable; urgency=low + + * New upstream version. + * Ported debian/rules to debhelper + * Upgraded the Debian policy conformance. + * Added some more docs to the package. + + -- Martin Paljak <mar...@ma...> Sat, 12 Apr 2003 15:18:18 +0300 + wisp (0.9.8-1) unstable; urgency=low * Upgraded the Debian policy conformance. Index: control =================================================================== RCS file: /cvsroot/wisp/wisp/debian/control,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- control 10 May 2002 07:24:38 -0000 1.3 +++ control 12 Apr 2003 12:34:29 -0000 1.4 @@ -2,12 +2,12 @@ Section: interpreters Priority: optional Maintainer: Andres Soolo <di...@us...> -Standards-Version: 3.5.6.1 +Standards-Version: 3.5.8 +Build-Depends: libgc-dev, nasm, libgmp3-dev Package: wisp Architecture: i386 Depends: ${shlibs:Depends} -Build-Depends: libgc-dev Description: Interpreter for the Wisp programming language A Lisp dialect mostly resembling Scheme. . Index: rules =================================================================== RCS file: /cvsroot/wisp/wisp/debian/rules,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- rules 8 Feb 2003 14:33:41 -0000 1.10 +++ rules 12 Apr 2003 12:34:29 -0000 1.11 @@ -9,59 +9,59 @@ #### @(#) $Id$ # Original: debian/rules for GNU Hello, by Ian Jackson +# Modified: heavy borrowing from hello-debhelper -package = wisp - -build: - $(checkdir) +build: copyright + dh_testdir ./configure --prefix=/usr - $(MAKE) + $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" touch build clean: - $(checkdir) - rm -f build + dh_testdir + dh_clean + rm -f debian/copyright -$(MAKE) -i distclean - rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars + rm -f build -binary: checkroot build - $(checkdir) - rm -rf debian/tmp - install -d debian/tmp/DEBIAN \ - -d debian/tmp/usr/bin \ - -d debian/tmp/usr/share/info \ - -d debian/tmp/usr/share/wisp \ - -d debian/tmp/usr/share/man/man1 \ - -d debian/tmp/usr/share/doc/wisp - install -m755 debian/postinst debian/prerm debian/tmp/DEBIAN - $(MAKE) prefix=$$(pwd)/debian/tmp/usr install - strip debian/tmp/usr/bin/wisp - strip -R.comment -R.note debian/tmp/usr/bin/wisp - gzip -9v debian/tmp/usr/share/info/wisp.info + +install: build + dh_clean + dh_installdirs + $(MAKE) prefix=$(CURDIR)/debian/tmp/usr \ + mandir=$(CURDIR)/debian/tmp/usr/share/man \ + infodir=$(CURDIR)/debian/tmp/usr/share/info \ + install + + +binary: install + dh_testdir + dh_testroot + dh_strip + dh_installdocs + dh_installchangelogs + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + + +.PHONY: binary clean install + + +# XXX + +.PHONY: copyright +copyright: + test -f debian/copyright || ( \ perl -npe 'exit if /full text of GPL/;' < COPYING \ - > debian/tmp/usr/share/doc/wisp/copyright + > debian/copyright; \ ( echo; \ echo On Debian systems, a copy of the GNU General; \ echo Public License is available in the file; \ echo \'/usr/share/common-licenses/GPL\'; \ - ) >> debian/tmp/usr/share/doc/wisp/copyright - cd debian/tmp/usr/share/doc/wisp && chmod 644 copyright - install -m644 debian/changelog \ - debian/tmp/usr/share/doc/wisp/changelog.Debian - cd debian/tmp/usr/share/doc/wisp && gzip -9v changelog.Debian - cd debian/tmp/usr/share/man/man1 && gzip -9v *.1 - dpkg-shlibdeps src/wisp - dpkg-gencontrol -isp - chown -R root.root debian/tmp - chmod -R g-ws debian/tmp - dpkg --build debian/tmp .. - -define checkdir - test -f debian/rules -endef - -checkroot: - $(checkdir) - test $$(id -u) -eq 0 + ) >> debian/copyright ) -.PHONY: binary clean checkroot |