develooper Front page | perl.perl6.internals | Postings from October 2002

[perl #18056] [PATCH] Extending the Packfile (Part 1.)

Thread Next
Jürgen" "Bömmels
October 22, 2002 12:01
[perl #18056] [PATCH] Extending the Packfile (Part 1.)
Message ID:
# New Ticket Created by  Jürgen Bömmels 
# Please include the string:  [perl #18056]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This patch is the beginning of an effort to make PackFile format
extendible. At the moment its combatible with the old bytecode

Ok, to the details:
It appends a 4th segment behind the 3 already defined segments (FIXUP,
CONSTANT and BYTECODE) name DIRECTORY. After this directory one ore
more uniquely named segments may follow. 

The directory segments start with the number of segments in the
PackFile, followed by a list of directory items. Each item constists
of a '\0' terminated c-string (padded to opcode_t-alignment), a
flag-word, the size of the corresponding segment and the position of
the segment in the packfile. The 4 first segments are nothing special,
expect that their name and order is fixed.

The implementation uses a glib style inheritance aproach. The
base-"class" of all Segments is struct PackFile_Segment which consists
of data-members for name, packfile, fileoffset, size and flags and
furter the member-functions destroy, packed_size, and pack. The
derived "classes" struct PackFile_Directory, PackFile_ConstTable
PackFile_FixupTable and PackFile_ByteCode (the later two are ATM just
dummy implementations) embed a PackFile_Segment as first elment so the
base-class can be get by a pointer cast.

Next steps might be:
- seperate the packfile.c in diffrent files (maybe move them to a
  directory/subsystem on its own as suggest by PDD07) one for each
- document the extension in parrotbyte.pod
- lower the restriction on the ordering of the first 4 segments
- write an objdump-like tool for manipulating packfiles. (I tried to
  extend pdump for that, but it segfaults in unmake_COW, a
  NULL-interpreter from PIO_eprintf)
- Teach the assembler to output the new format. (imcc uses AFAIK
  packout.c and should already work)


-- attachment  1 ------------------------------------------------------

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About