home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-Update.iso / NEXTSTEP / developer / objc / mach / dis.README < prev    next >
Encoding:
Text File  |  1997-06-05  |  2.4 KB  |  60 lines

  1. This is a version of Bill Spitzak's Mach-O object file format
  2. 680x0 disassembler.  It was originally distributed along with
  3. "Hack Kit 2" just as NeXTStep 2.0 was released.
  4.  
  5. I needed a disassembler and I found the source code this is based
  6. on.  It didn't compile at all under NeXTstep 3.0.  So, I hacked on
  7. it a little bit.  Now it compiles fairly cleanly under NeXTStep 3.2,
  8. and it still does the same disassembly as it used to.
  9.  
  10. Bruce Ediger
  11. bediger@teal.csn.org
  12. ediger@metamatic.denver.co.us
  13.  
  14.  
  15. Main changes:
  16.  
  17. 1. Total reformatting of source code.  The original style was a little
  18.    eccentric, seemingly chosen to minimize source code line count at
  19.    the expense of clarity.
  20.  
  21. 2. Removed most of the Magic Numbers used in the code, replaced them
  22.    with symbolic constants from system .h files.  There's still a
  23.    few Magic Number Constants in the actual disassembly, but they
  24.    don't have a header file replacement.  The original code seemed
  25.    to have an allergy to symbolic constants.
  26.  
  27. 3. Made the Mach-O file support work with the official system header
  28.    files.  Spitzak had concocted some custom thing that subsumed most
  29.    of mach-o/loader.h, mach-o/nlist.h, mach-o/ldsyms.h and a few others.
  30.    Needless to say, this concoction didn't track official NeXT include
  31.    file updates.  This change necessitated changing arguments to a lot
  32.    of the functions that dealt with Mach-O files, or the original author's
  33.    conception of them.
  34.  
  35. 4. Removed a few inexplicable things like using lseek() to find a file's
  36.    size.
  37.  
  38. 5. Used a simple memory-mapped file object to replace the scattered
  39.    uses of map_fd().  This neccessitated making the main() routine be
  40.    Objective-C source.
  41.  
  42.  
  43.  
  44. What I couldn't do, but wanted to do:
  45.  
  46. 1. Make the symbol table use comprehensible.  I still don't really
  47.    understand what's going on.  It seems to me that the
  48.    code does things the hard way.  A hashtable or something might
  49.    be faster and more understandable, but I was afraid to replace
  50.    the code already existant because it seems to work.
  51.  
  52. 2. Make it use the symbol table and/or LINKEDIT info from shared
  53.    libraries to identify calls into the shared libraries.  This
  54.    stems from the odd symbol table stuff.  Unfortunately, a dissassembly
  55.    of a stripped object file won't be as informative as it could.
  56.  
  57. 3. Make it completely ANSI C.  There appears to be some hoseup in
  58.    sys/types.h vs bsd/libc.h in the NeXTStep 3.2 include files.
  59.    Or kill me.
  60.