Teach cvmach to emit the symbol table.
authorGeorge Koehler <xkernigh@netscape.net>
Tue, 22 Nov 2016 22:16:30 +0000 (17:16 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Tue, 22 Nov 2016 22:16:30 +0000 (17:16 -0500)
commit98f2273d97b85f55aa950b1d439714c054cf2d32
treedd83d5099ada3c6a1e6d23cbb9bac3fcfa716de5
parent19310d2521ddf88e896ecf9c4ee5a1fe7fe9aab8
Teach cvmach to emit the symbol table.

This preserves the name and value of every symbol.  The type and other
info of a symbol might be lost.  In gdb, one can now "disas main" or
"disas '.ret'" to disassemble functions by name.

Most symbols are in sections, so I also teach cvmach to emit the Mach
section headers.  The entry point in plat/osx*/descr moves down to
make room for the section headers and LC_SYMTAB.

I fix some bugs in calculations of cvmach.  They were wrong if ROM had
a greater alignment than TEXT, or if DATA did not start on a page
boundary.  I introduce machseg[] to simplify the mess of variables in
main().  I declare most functions as static.  Also, cvmach becomes the
first program to #include <object.h>.
plat/osx/cvmach/build.lua
plat/osx/cvmach/cvmach.c
plat/osx386/descr
plat/osxppc/descr