b3be282132f408aa891c4d03bce7ca4341f0cc8d
[org.ibex.core.git] / upstream / darwin-linker / patches / include.patch
1 Only in include/: 2.0Compat
2 Only in include/: CVS
3 diff -rub include/Makefile include/Makefile
4 --- include/Makefile    Fri Sep  6 18:27:31 2002
5 +++ include/Makefile    Mon Aug 25 12:12:28 2003
6 @@ -11,7 +11,7 @@
7         mach-o/nlist.h mach-o/stab.h mach-o/loader.h mach-o/fat.h \
8         mach-o/dyld_debug.h mach-o/arch.h mach-o/gmon.h mach-o/ranlib.h \
9         mach-o/swap.h mach-o/getsect.h mach-o/i386/swap.h mach-o/dyld_gdb.h \
10 -       mach-o/ppc/swap.h mach-o/ppc/reloc.h \
11 +       mach-o/ppc/swap.h mach-o/ppc/reloc.h
12  
13  LOCFILES = mach-o/rld_state.h mach-o/rld.h mach-o/sarld.h mach-o/kld.h \
14            mach-o/redo_prebinding.h \
15 @@ -19,7 +19,8 @@
16            mach-o/hppa/swap.h mach-o/hppa/reloc.h \
17            mach-o/m88k/swap.h mach-o/m88k/reloc.h \
18            mach-o/m68k/swap.h \
19 -          mach-o/sparc/swap.h mach-o/sparc/reloc.h
20 +          mach-o/sparc/swap.h mach-o/sparc/reloc.h \
21 +          cbt/libsyminfo.h
22  
23  # Note that OTHER_SRCS do NOT get installed
24  OTHER_SRCS = notes gnu/symseg.h \
25 @@ -30,7 +31,8 @@
26              stuff/print.h stuff/version_number.h stuff/crc32.h sys/gmon.h \
27              stuff/openstep_mach.h stuff/seg_addr_table.h stuff/dylib_table.h \
28              stuff/SymLoc.h stuff/dylib_roots.h stuff/guess_short_name.h \
29 -            stuff/macosx_deployment_target.h
30 +            stuff/macosx_deployment_target.h stuff/symbol_list.h
31 +
32  ENCUMBERED_SRCS = gnu/a.out.h gnu/exec.h
33  
34  # Note that MISSING_SRCS are those may not be on all build machines
35 @@ -78,6 +80,7 @@
36  ENCUMBERED_SRC_FILES = $(SRC_FILES) $(ENCUMBERED_SRCS)
37  
38  installsrc:
39 +       echo installsrc
40         $(MKDIRS) $(SRCROOT)
41         chmod 755 $(SRCROOT)
42         gnutar cf - $(ENCUMBERED_SRC_FILES) | (cd $(SRCROOT); gnutar xf -)
43 @@ -126,6 +129,9 @@
44         cd stuff; \
45             install -c -m 444 ${IFLAGS} bool.h \
46             ${DSTROOT}${$(RC_OS)_LOCINCDIR}/dyld
47 +       cd cbt; \
48 +           install -c -m 444 ${IFLAGS} libsyminfo.h \
49 +           ${DSTROOT}${$(RC_OS)_LOCINCDIR}/cbt
50  
51  dirs:
52         $(MKDIRS) ${DSTROOT}${$(RC_OS)_INCDIR}/mach-o/i386
53 @@ -136,6 +142,7 @@
54         $(MKDIRS) ${DSTROOT}${$(RC_OS)_LOCINCDIR}/mach-o/i860
55         $(MKDIRS) ${DSTROOT}${$(RC_OS)_LOCINCDIR}/mach-o/m88k
56         $(MKDIRS) ${DSTROOT}${$(RC_OS)_LOCINCDIR}/dyld
57 +       $(MKDIRS) ${DSTROOT}${$(RC_OS)_LOCINCDIR}/cbt
58  
59  depend:
60  
61 Only in include/architecture: CVS
62 Only in include/architecture/i386: CVS
63 diff -rub include/architecture/i386/fpu.h include/architecture/i386/fpu.h
64 --- include/architecture/i386/fpu.h     Tue Apr 30 00:37:18 2002
65 +++ include/architecture/i386/fpu.h     Mon Aug 25 12:56:22 2003
66 @@ -121,7 +121,7 @@
67                                         :3;
68  } fp_control_t;
69  
70 -#import <architecture/i386/sel.h>
71 +#include <architecture/i386/sel.h>
72  
73  /*
74   * Floating point 'environment'
75 diff -rub include/architecture/i386/frame.h include/architecture/i386/frame.h
76 --- include/architecture/i386/frame.h   Tue Apr 30 00:37:18 2002
77 +++ include/architecture/i386/frame.h   Mon Aug 25 12:56:22 2003
78 @@ -63,7 +63,7 @@
79      } pgfault;
80  } err_code_t;
81  
82 -#import <architecture/i386/sel.h>
83 +#include <architecture/i386/sel.h>
84  
85  /*
86   * The actual hardware exception frame
87 Only in include/architecture/m88k: CVS
88 diff -rub include/architecture/m88k/fp_regs.h include/architecture/m88k/fp_regs.h
89 --- include/architecture/m88k/fp_regs.h Tue Jan 14 23:35:23 2003
90 +++ include/architecture/m88k/fp_regs.h Mon Aug 25 12:56:22 2003
91 @@ -37,7 +37,7 @@
92  #ifndef        _ARCH_M88K_FP_REGS_H_
93  #define        _ARCH_M88K_FP_REGS_H_
94  
95 -#import <architecture/m88k/reg_help.h>
96 +#include <architecture/m88k/reg_help.h>
97  
98  /*
99   * m88k_xrf_t -- data types that MAY be in extended register file
100 diff -rub include/architecture/m88k/reg_help.h include/architecture/m88k/reg_help.h
101 --- include/architecture/m88k/reg_help.h        Tue Jan 14 23:35:23 2003
102 +++ include/architecture/m88k/reg_help.h        Mon Aug 25 12:56:22 2003
103 @@ -37,7 +37,7 @@
104  #ifndef _ARCH_M88K_REG_HELP_H_
105  #define _ARCH_M88K_REG_HELP_H_
106  
107 -#import <architecture/nrw/reg_help.h>
108 +#include <architecture/nrw/reg_help.h>
109  
110  /* Stack pointer must always be a multiple of 16 */
111  #define        STACK_INCR      16
112 Only in include/architecture/nrw: CVS
113 Only in include/architecture: ppc
114 Only in include/architecture/sparc: CVS
115 Only in include/: cbt
116 Only in include/gnu: CVS
117 Only in include/: gpul_notes
118 Only in include/mach: CVS
119 Only in include/mach/hppa: CVS
120 Only in include/mach: i386
121 Only in include/mach/i860: CVS
122 Only in include/mach/m68k: CVS
123 Only in include/mach/m88k: CVS
124 diff -rub include/mach/m88k/thread_status.h include/mach/m88k/thread_status.h
125 --- include/mach/m88k/thread_status.h   Tue Jan 14 23:35:24 2003
126 +++ include/mach/m88k/thread_status.h   Mon Aug 25 12:56:22 2003
127 @@ -45,8 +45,8 @@
128  #ifndef        _MACH_M88K_THREAD_STATE_
129  #define        _MACH_M88K_THREAD_STATE_
130  
131 -#import <architecture/m88k/fp_regs.h>
132 -#import <architecture/m88k/reg_help.h>
133 +#include <architecture/m88k/fp_regs.h>
134 +#include <architecture/m88k/reg_help.h>
135  
136  /**************************************************************************
137   * Data Typedefs used by thread_getstatus() and thread_setstatus()        *
138 Only in include/mach: m98k
139 diff -rub include/mach/machine.h include/mach/machine.h
140 --- include/mach/machine.h      Tue Jan 14 23:35:24 2003
141 +++ include/mach/machine.h      Mon Aug 25 12:56:22 2003
142 @@ -81,8 +81,8 @@
143  #ifndef        _MACH_MACHINE_H_
144  #define _MACH_MACHINE_H_
145  
146 -#import <mach/machine/vm_types.h>
147 -#import <mach/boolean.h>
148 +#include <mach/machine/vm_types.h>
149 +#include <mach/boolean.h>
150  
151  /*
152   *     For each host, there is a maximum possible number of
153 @@ -355,6 +355,7 @@
154  #define CPU_SUBTYPE_POWERPC_750                ((cpu_subtype_t) 9)
155  #define CPU_SUBTYPE_POWERPC_7400       ((cpu_subtype_t) 10)
156  #define CPU_SUBTYPE_POWERPC_7450       ((cpu_subtype_t) 11)
157 +#define CPU_SUBTYPE_POWERPC_970                ((cpu_subtype_t) 100)
158  
159  /*
160   * VEO subtypes
161 Only in include/mach/ppc: CVS
162 Only in include/mach/sparc: CVS
163 Only in include/mach-o: CVS
164 diff -rub include/mach-o/dyld.h include/mach-o/dyld.h
165 --- include/mach-o/dyld.h       Fri Sep  6 18:27:36 2002
166 +++ include/mach-o/dyld.h       Mon Aug 25 12:56:22 2003
167 @@ -48,7 +48,7 @@
168   * The high level NS... API.
169   */
170  
171 -/* Object file image api */
172 +/* Object file image API */
173  typedef enum {
174      NSObjectFileImageFailure, /* for this a message is printed on stderr */
175      NSObjectFileImageSuccess,
176 @@ -75,41 +75,39 @@
177  extern enum DYLD_BOOL NSDestroyObjectFileImage(
178      NSObjectFileImage objectFileImage);
179  /*
180 - * Need api on NSObjectFileImage's for:
181 + * API on NSObjectFileImage's for:
182   *   "for Each Symbol Definition In Object File Image" (for Dynamic Bundles)
183 - *   Could have the same thing for references
184 + *   and the same thing for references
185   */
186 -/* not yet implemented */
187  extern unsigned long NSSymbolDefinitionCountInObjectFileImage(
188      NSObjectFileImage objectFileImage);
189 -/* not yet implemented */
190  extern const char * NSSymbolDefinitionNameInObjectFileImage(
191      NSObjectFileImage objectFileImage,
192      unsigned long ordinal);
193 -/* not yet implemented */
194  extern unsigned long NSSymbolReferenceCountInObjectFileImage(
195      NSObjectFileImage objectFileImage);
196 -/* not yet implemented */
197  extern const char * NSSymbolReferenceNameInObjectFileImage(
198      NSObjectFileImage objectFileImage,
199      unsigned long ordinal,
200      enum DYLD_BOOL *tentative_definition); /* can be NULL */
201  /*
202 - * Other needed api on NSObjectFileImage:
203 + * API on NSObjectFileImage:
204   *   "does Object File Image define symbol name X" (using sorted symbol table)
205 - *   a way to get the named objective-C section
206 + *   and a way to get the named objective-C section
207   */
208 -/* not yet implemented */
209  extern enum DYLD_BOOL NSIsSymbolDefinedInObjectFileImage(
210      NSObjectFileImage objectFileImage,
211      const char *symbolName);
212 -/* not yet implemented */
213  extern void * NSGetSectionDataInObjectFileImage(
214      NSObjectFileImage objectFileImage,
215      const char *segmentName,
216 -    const char *sectionName);
217 +    const char *sectionName,
218 +    unsigned long *size); /* can be NULL */
219 +/* SPI first appeared in Mac OS X 10.3 */
220 +extern enum DYLD_BOOL NSHasModInitObjectFileImage(
221 +    NSObjectFileImage objectFileImage);
222  
223 -/* module api */
224 +/* module API */
225  typedef void * NSModule;
226  extern const char * NSNameOfModule(
227      NSModule m); 
228 @@ -125,6 +123,8 @@
229  #define NSLINKMODULE_OPTION_BINDNOW            0x1
230  #define NSLINKMODULE_OPTION_PRIVATE            0x2
231  #define NSLINKMODULE_OPTION_RETURN_ON_ERROR    0x4
232 +#define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8
233 +#define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10
234  
235  /* limited implementation, only modules loaded with NSLinkModule() can be
236     unlinked */
237 @@ -141,7 +141,7 @@
238      NSObjectFileImage newObjectFileImage, 
239      unsigned long options);
240  
241 -/* symbol api */
242 +/* symbol API */
243  typedef void * NSSymbol;
244  extern enum DYLD_BOOL NSIsSymbolNameDefined(
245      const char *symbolName);
246 @@ -174,7 +174,7 @@
247  extern NSModule NSModuleForSymbol(
248      NSSymbol symbol);
249  
250 -/* error handling api */
251 +/* error handling API */
252  typedef enum {
253      NSLinkEditFileAccessError,
254      NSLinkEditFileFormatError,
255 @@ -216,7 +216,7 @@
256  extern void NSInstallLinkEditErrorHandlers(
257      NSLinkEditErrorHandlers *handlers);
258  
259 -/* other api */
260 +/* other API */
261  extern enum DYLD_BOOL NSAddLibrary(
262      const char *pathName);
263  extern enum DYLD_BOOL NSAddLibraryWithSearching(
264 @@ -273,10 +273,18 @@
265      void *objc_module);
266  extern enum DYLD_BOOL _dyld_bind_fully_image_containing_address(
267      unsigned long *address);
268 +extern enum DYLD_BOOL _dyld_image_containing_address(
269 +    unsigned long address);
270 +/* SPI first appeared in Mac OS X 10.3 */
271 +extern struct mach_header * _dyld_get_image_header_containing_address(
272 +    unsigned long address);
273  
274  extern void _dyld_moninit(
275      void (*monaddition)(char *lowpc, char *highpc));
276  extern enum DYLD_BOOL _dyld_launched_prebound(
277 +    void);
278 +/* SPI first appeared in Mac OS X 10.3 */
279 +extern enum DYLD_BOOL _dyld_all_twolevel_modules_prebound(
280      void);
281  
282  extern void _dyld_lookup_and_bind(
283 diff -rub include/mach-o/dyld_gdb.h include/mach-o/dyld_gdb.h
284 --- include/mach-o/dyld_gdb.h   Tue Apr 30 00:37:19 2002
285 +++ include/mach-o/dyld_gdb.h   Mon Aug 25 12:56:22 2003
286 @@ -9,7 +9,7 @@
287  /*
288   * gdb_dyld_version is the version of gdb interface that dyld is currently
289   * exporting.  For the interface described in this header file gdb_dyld_version
290 - * is 1.  As the gdb/dyld interface changes this number will be incremented and
291 + * is 2.  As the gdb/dyld interface changes this number will be incremented and
292   * comments will be added as to what are the are changes for the various
293   * versions.
294   */
295 @@ -48,12 +48,21 @@
296   * start with a structure containing the following fields:
297   *
298   *  struct image {   
299 - *      char *name;                 image name for reporting errors
300 + *      char *physical_name;        physical image name (file name)
301   *      unsigned long vmaddr_slide; the slide from the staticly linked address
302   *      struct mach_header *mh;     address of the mach header of the image
303   *     unsigned long valid;        TRUE if this is struct is valid
304 + *      char *name;                 image name for reporting errors
305   *      ...
306   *  };
307 + *
308 + * In gdb_dyld_version 1 the first field was "name".  In gdb_dyld_version 2 the
309 + * first field was changed to "physical_name" and a new fifth field "name" was
310 + * added.  These two fields are set to the same values except in the case of
311 + * zero-link.  In zero-link the NSLinkModule() option
312 + * NSLINKMODULE_OPTION_TRAILING_PHYS_NAME is used and then the physical_name is
313 + * the file name of the module zero-link loaded that is part of the logical
314 + * image "name".
315   */
316  
317  /* object_images is the global object_images structure */
318 Only in include/mach-o/hppa: CVS
319 diff -rub include/mach-o/hppa/swap.h include/mach-o/hppa/swap.h
320 --- include/mach-o/hppa/swap.h  Tue Apr 30 00:37:19 2002
321 +++ include/mach-o/hppa/swap.h  Mon Aug 25 12:56:22 2003
322 @@ -21,8 +21,8 @@
323   * 
324   * @APPLE_LICENSE_HEADER_END@
325   */
326 -#import <architecture/byte_order.h>
327 -#import <mach/hppa/thread_status.h>
328 +#include <architecture/byte_order.h>
329 +#include <mach/hppa/thread_status.h>
330  
331  extern void swap_hppa_integer_thread_state(
332      struct hp_pa_integer_thread_state *regs,
333 Only in include/mach-o/i386: CVS
334 Only in include/mach-o/i860: CVS
335 diff -rub include/mach-o/i860/swap.h include/mach-o/i860/swap.h
336 --- include/mach-o/i860/swap.h  Tue Apr 30 00:37:19 2002
337 +++ include/mach-o/i860/swap.h  Mon Aug 25 12:56:22 2003
338 @@ -21,8 +21,8 @@
339   * 
340   * @APPLE_LICENSE_HEADER_END@
341   */
342 -#import <architecture/byte_order.h>
343 -#import <mach/i860/thread_status.h>
344 +#include <architecture/byte_order.h>
345 +#include <mach/i860/thread_status.h>
346  
347  extern void swap_i860_thread_state_regs(
348      struct i860_thread_state_regs *cpu,
349 diff -rub include/mach-o/kld.h include/mach-o/kld.h
350 --- include/mach-o/kld.h        Tue Apr 30 00:37:19 2002
351 +++ include/mach-o/kld.h        Mon Aug 25 12:56:22 2003
352 @@ -51,11 +51,6 @@
353  __private_extern__ long kld_load_basefile(
354      const char *base_filename);
355  
356 -__private_extern__ long kld_load_basefile_from_memory(
357 -    const char *base_filename,
358 -    char *base_addr,
359 -    long base_size);
360 -
361  /* Note: this takes only one object file name */
362  __private_extern__ long kld_load(
363      struct mach_header **header_addr,
364 @@ -71,7 +66,7 @@
365  #endif /* __DYNAMIC__ */
366  
367  /*
368 - * This two are only in libkld.a use by /mach_kernel (kernel code compiled with
369 + * This one is only in libkld.a use by /mach_kernel (kernel code compiled with
370   * -static).
371   */
372  #ifdef __STATIC__
373 @@ -83,6 +78,11 @@
374      long object_size);
375  #endif /* __STATIC__ */
376  
377 +__private_extern__ long kld_load_basefile_from_memory(
378 +    const char *base_filename,
379 +    char *base_addr,
380 +    long base_size);
381 +
382  __private_extern__ long kld_unload_all(
383      long deallocate_sets);
384  
385 @@ -95,5 +95,11 @@
386  
387  __private_extern__ void kld_address_func(
388      unsigned long (*func)(unsigned long size, unsigned long headers_size));
389 +
390 +#define KLD_STRIP_ALL  0x00000000
391 +#define KLD_STRIP_NONE 0x00000001
392 +
393 +__private_extern__ void kld_set_link_options(
394 +    unsigned long link_options);
395  
396  #endif /* _MACHO_KLD_H_ */
397 diff -rub include/mach-o/loader.h include/mach-o/loader.h
398 --- include/mach-o/loader.h     Tue Jan 14 23:35:24 2003
399 +++ include/mach-o/loader.h     Mon Aug 25 12:56:22 2003
400 @@ -92,9 +92,11 @@
401  #define        MH_FVMLIB       0x3             /* fixed VM shared library file */
402  #define        MH_CORE         0x4             /* core file */
403  #define        MH_PRELOAD      0x5             /* preloaded executable file */
404 -#define        MH_DYLIB        0x6             /* dynamicly bound shared library file*/
405 +#define        MH_DYLIB        0x6             /* dynamically bound shared library */
406  #define        MH_DYLINKER     0x7             /* dynamic link editor */
407 -#define        MH_BUNDLE       0x8             /* dynamicly bound bundle file */
408 +#define        MH_BUNDLE       0x8             /* dynamically bound bundle file */
409 +#define        MH_DYLIB_STUB   0x9             /* shared library stub for static */
410 +                                       /*  linking only, no section contents */
411  
412  /* Constants for the flags field of the mach_header */
413  #define        MH_NOUNDEFS     0x1             /* the object file has no undefined
414 @@ -123,7 +125,7 @@
415  #define MH_NOMULTIDEFS 0x200           /* this umbrella guarantees no multiple
416                                            defintions of symbols in its
417                                            sub-images so the two-level namespace
418 -                                          hints can alwasys be used. */
419 +                                          hints can always be used. */
420  #define MH_NOFIXPREBINDING 0x400       /* do not have dyld notify the
421                                            prebinding agent about this
422                                            executable */
423 @@ -171,11 +173,11 @@
424  #define LC_FVMFILE     0x9     /* fixed VM file inclusion (internal use) */
425  #define LC_PREPAGE      0xa     /* prepage command (internal use) */
426  #define        LC_DYSYMTAB     0xb     /* dynamic link-edit symbol table info */
427 -#define        LC_LOAD_DYLIB   0xc     /* load a dynamicly linked shared library */
428 -#define        LC_ID_DYLIB     0xd     /* dynamicly linked shared lib identification */
429 +#define        LC_LOAD_DYLIB   0xc     /* load a dynamically linked shared library */
430 +#define        LC_ID_DYLIB     0xd     /* dynamically linked shared lib ident */
431  #define LC_LOAD_DYLINKER 0xe   /* load a dynamic linker */
432  #define LC_ID_DYLINKER 0xf     /* dynamic linker identification */
433 -#define        LC_PREBOUND_DYLIB 0x10  /* modules prebound for a dynamicly */
434 +#define        LC_PREBOUND_DYLIB 0x10  /* modules prebound for a dynamically */
435                                 /*  linked shared library */
436  #define        LC_ROUTINES     0x11    /* image routines */
437  #define        LC_SUB_FRAMEWORK 0x12   /* sub framework */
438 @@ -184,7 +186,10 @@
439  #define        LC_SUB_LIBRARY  0x15    /* sub library */
440  #define        LC_TWOLEVEL_HINTS 0x16  /* two-level namespace lookup hints */
441  #define        LC_PREBIND_CKSUM  0x17  /* prebind checksum */
442 -/* load a dynamicly linked shared library that is allowed to be missing (weak)*/
443 +/*
444 + * load a dynamically linked shared library that is allowed to be missing
445 + * (all symbols are weak imported).
446 + */
447  #define        LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
448  
449  /*
450 @@ -438,9 +443,9 @@
451  };
452  
453  /*
454 - * A dynamicly linked shared library (filetype == MH_DYLIB in the mach header)
455 + * A dynamically linked shared library (filetype == MH_DYLIB in the mach header)
456   * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library.
457 - * An object that uses a dynamicly linked shared library also contains a
458 + * An object that uses a dynamically linked shared library also contains a
459   * dylib_command (cmd == LC_LOAD_DYLIB or cmd == LC_LOAD_WEAK_DYLIB) for each
460   * library it uses.
461   */
462 @@ -522,7 +527,7 @@
463  };
464  
465  /*
466 - * A program (filetype == MH_EXECUTE) or bundle (filetype == MH_BUNDLE) that is
467 + * A program (filetype == MH_EXECUTE) that is
468   * prebound to its dynamic libraries has one of these for each library that
469   * the static linker used in prebinding.  It contains a bit vector for the
470   * modules in the library.  The bits indicate which modules are bound (1) and
471 @@ -618,7 +623,7 @@
472  
473  /*
474   * This is the second set of the symbolic information which is used to support
475 - * the data structures for the dynamicly link editor.
476 + * the data structures for the dynamically link editor.
477   *
478   * The original set of symbolic information in the symtab_command which contains
479   * the symbol and string tables must also be present when this load command is
480 @@ -639,7 +644,7 @@
481   *     reference symbol table
482   *     indirect symbol table
483   * The first three tables above (the table of contents, module table and
484 - * reference symbol table) are only present if the file is a dynamicly linked
485 + * reference symbol table) are only present if the file is a dynamically linked
486   * shared library.  For executable and object modules, which are files
487   * containing only one module, the information that would be in these three
488   * tables is determined as follows:
489 @@ -648,7 +653,7 @@
490   *                    file is part of the module.
491   *     reference symbol table - is the defined and undefined external symbols
492   *
493 - * For dynamicly linked shared library files this load command also contains
494 + * For dynamically linked shared library files this load command also contains
495   * offsets and sizes to the pool of relocation entries for all sections
496   * separated into two groups:
497   *     external relocation entries
498 @@ -673,7 +678,7 @@
499       *
500       * The last two groups are used by the dynamic binding process to do the
501       * binding (indirectly through the module table and the reference symbol
502 -     * table when this is a dynamicly linked shared library file).
503 +     * table when this is a dynamically linked shared library file).
504       */
505      unsigned long ilocalsym;   /* index to local symbols */
506      unsigned long nlocalsym;   /* number of local symbols */
507 @@ -688,7 +693,7 @@
508       * For the for the dynamic binding process to find which module a symbol
509       * is defined in the table of contents is used (analogous to the ranlib
510       * structure in an archive) which maps defined external symbols to modules
511 -     * they are defined in.  This exists only in a dynamicly linked shared
512 +     * they are defined in.  This exists only in a dynamically linked shared
513       * library file.  For executable and object modules the defined external
514       * symbols are sorted by name and is use as the table of contents.
515       */
516 @@ -700,7 +705,7 @@
517       * table must reflect the modules that the file was created from.  This is
518       * done by having a module table that has indexes and counts into the merged
519       * tables for each module.  The module structure that these two entries
520 -     * refer to is described below.  This exists only in a dynamicly linked
521 +     * refer to is described below.  This exists only in a dynamically linked
522       * shared library file.  For executable and object modules the file only
523       * contains one module so everything in the file belongs to the module.
524       */
525 @@ -712,7 +717,7 @@
526       * indicates the external references (defined and undefined) each module
527       * makes.  For each module there is an offset and a count into the
528       * reference symbol table for the symbols that the module references.
529 -     * This exists only in a dynamicly linked shared library file.  For
530 +     * This exists only in a dynamically linked shared library file.  For
531       * executable and object modules the defined external symbols and the
532       * undefined external symbols indicates the external references.
533       */
534 Only in include/mach-o/m68k: CVS
535 diff -rub include/mach-o/m68k/swap.h include/mach-o/m68k/swap.h
536 --- include/mach-o/m68k/swap.h  Tue Apr 30 00:37:19 2002
537 +++ include/mach-o/m68k/swap.h  Mon Aug 25 12:56:22 2003
538 @@ -21,8 +21,8 @@
539   * 
540   * @APPLE_LICENSE_HEADER_END@
541   */
542 -#import <architecture/byte_order.h>
543 -#import <mach/m68k/thread_status.h>
544 +#include <architecture/byte_order.h>
545 +#include <mach/m68k/thread_status.h>
546  
547  extern void swap_m68k_thread_state_regs(
548      struct m68k_thread_state_regs *cpu,
549 Only in include/mach-o/m88k: CVS
550 diff -rub include/mach-o/m88k/swap.h include/mach-o/m88k/swap.h
551 --- include/mach-o/m88k/swap.h  Tue Apr 30 00:37:19 2002
552 +++ include/mach-o/m88k/swap.h  Mon Aug 25 12:56:22 2003
553 @@ -21,8 +21,8 @@
554   * 
555   * @APPLE_LICENSE_HEADER_END@
556   */
557 -#import <architecture/byte_order.h>
558 -#import <mach/m88k/thread_status.h>
559 +#include <architecture/byte_order.h>
560 +#include <mach/m88k/thread_status.h>
561  
562  extern void swap_m88k_thread_state_grf_t(
563      m88k_thread_state_grf_t *cpu,
564 diff -rub include/mach-o/nlist.h include/mach-o/nlist.h
565 --- include/mach-o/nlist.h      Tue Jan 14 23:35:24 2003
566 +++ include/mach-o/nlist.h      Mon Aug 25 12:56:22 2003
567 @@ -198,15 +198,24 @@
568   * undefined references from module defined in another use the same nlist struct
569   * an in that case SELF_LIBRARY_ORDINAL is used as the library ordinal.  For
570   * defined symbols in all images they also must have the library ordinal set to
571 - * SELF_LIBRARY_ORDINAL.  The EXECUTABLE_ORDINAL is refers to the executable
572 + * SELF_LIBRARY_ORDINAL.  The EXECUTABLE_ORDINAL refers to the executable
573   * image for references from plugins that refer to the executable that loads
574   * them.
575 + * 
576 + * The DYNAMIC_LOOKUP_ORDINAL is for undefined symbols in a two-level namespace
577 + * image that are looked up by the dynamic linker with flat namespace semantics.
578 + * This ordinal was added as a feature in Mac OS X 10.3 by reducing the
579 + * value of MAX_LIBRARY_ORDINAL by one.  So it is legal for existing binaries
580 + * or binaries built with older tools to have 0xfe (254) dynamic libraries.  In
581 + * this case the ordinal value 0xfe (254) must be treated as a library ordinal
582 + * for compatibility. 
583   */
584  #define GET_LIBRARY_ORDINAL(n_desc) (((n_desc) >> 8) & 0xff)
585  #define SET_LIBRARY_ORDINAL(n_desc,ordinal) \
586         (n_desc) = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8))
587  #define SELF_LIBRARY_ORDINAL 0x0
588 -#define MAX_LIBRARY_ORDINAL 0xfe
589 +#define MAX_LIBRARY_ORDINAL 0xfd
590 +#define DYNAMIC_LOOKUP_ORDINAL 0xfe
591  #define EXECUTABLE_ORDINAL 0xff
592  
593  /*
594 Only in include/mach-o/ppc: CVS
595 diff -rub include/mach-o/ppc/reloc.h include/mach-o/ppc/reloc.h
596 --- include/mach-o/ppc/reloc.h  Tue Apr 30 00:37:19 2002
597 +++ include/mach-o/ppc/reloc.h  Mon Aug 25 12:56:22 2003
598 @@ -27,7 +27,14 @@
599   * above and their r_type is RELOC_VANILLA.  The rest of the relocation types
600   * are for instructions.  Since they are for instructions the r_address field
601   * indicates the 32 bit instruction that the relocation is to be preformed on.
602 - * The fields r_pcrel and r_length are ignored for non-RELOC_VANILLA r_types.
603 + * The fields r_pcrel and r_length are ignored for non-RELOC_VANILLA r_types
604 + * except for PPC_RELOC_BR14.
605 + *
606 + * For PPC_RELOC_BR14 if the r_length is the unused value 3, then the branch was
607 + * statically predicted setting or clearing the Y-bit based on the sign of the
608 + * displacement or the opcode.  If this is the case the static linker must flip
609 + * the value of the Y-bit if the sign of the displacement changes for non-branch
610 + * always conditions.
611   */
612  enum reloc_type_ppc
613  {
614 @@ -45,12 +52,13 @@
615                          */
616      PPC_RELOC_LO14,    /* Same as the LO16 except that the low 2 bits are not
617                          * stored in the instruction and are always zero.  This
618 -                        * is used for in double word load/store instructons.
619 +                        * is used in double word load/store instructions.
620                          */
621      PPC_RELOC_SECTDIFF,        /* a PAIR follows with subtract symbol value */
622      PPC_RELOC_PB_LA_PTR,/* prebound lazy pointer */
623      PPC_RELOC_HI16_SECTDIFF, /* section difference forms of above.  a PAIR */
624      PPC_RELOC_LO16_SECTDIFF, /* follows these with subtract symbol value */
625      PPC_RELOC_HA16_SECTDIFF,
626 -    PPC_RELOC_JBSR
627 +    PPC_RELOC_JBSR,
628 +    PPC_RELOC_LO14_SECTDIFF
629  };
630 diff -rub include/mach-o/rld.h include/mach-o/rld.h
631 --- include/mach-o/rld.h        Fri Sep  6 18:27:39 2002
632 +++ include/mach-o/rld.h        Mon Aug 25 12:56:22 2003
633 @@ -28,7 +28,7 @@
634  #ifndef _MACHO_RLD_H_
635  #define _MACHO_RLD_H_
636  
637 -#include <streams/streams.h>
638 +//~ #include <streams/streams.h>
639  #include <mach-o/loader.h>
640  
641  extern long rld_load(
642 Only in include/mach-o/sparc: CVS
643 diff -rub include/mach-o/sparc/swap.h include/mach-o/sparc/swap.h
644 --- include/mach-o/sparc/swap.h Tue Apr 30 00:37:19 2002
645 +++ include/mach-o/sparc/swap.h Mon Aug 25 12:56:22 2003
646 @@ -21,8 +21,8 @@
647   * 
648   * @APPLE_LICENSE_HEADER_END@
649   */
650 -#import <architecture/byte_order.h>
651 -#import <mach/sparc/thread_status.h>
652 +#include <architecture/byte_order.h>
653 +#include <mach/sparc/thread_status.h>
654  
655  void swap_sparc_thread_state_regs(
656      struct sparc_thread_state_regs *cpu,
657 diff -rub include/mach-o/stab.h include/mach-o/stab.h
658 --- include/mach-o/stab.h       Tue Jan 14 23:35:24 2003
659 +++ include/mach-o/stab.h       Mon Aug 25 12:56:22 2003
660 @@ -91,6 +91,7 @@
661  #define        N_STSYM 0x26    /* static symbol: name,,n_sect,type,address */
662  #define        N_LCSYM 0x28    /* .lcomm symbol: name,,n_sect,type,address */
663  #define N_BNSYM 0x2e   /* begin nsect sym: 0,,n_sect,0,address */
664 +#define N_OPT  0x3c    /* emitted with gcc2_compiled and in gcc source */
665  #define        N_RSYM  0x40    /* register sym: name,,NO_SECT,type,register */
666  #define        N_SLINE 0x44    /* src line: 0,,n_sect,linenumber,address */
667  #define N_ENSYM 0x4e   /* end nsect sym: 0,,n_sect,0,address */
668 diff -rub include/notes include/notes
669 --- include/notes       Tue Jan 14 23:35:23 2003
670 +++ include/notes       Mon Aug 25 12:12:28 2003
671 @@ -1,3 +1,96 @@
672 +Changes for the 5.12 release (the cctools-477 release):
673 +- Changed <mach-o/kld.h> to make kld_load_basefile_from_memory() available for
674 +  both __DYNAMIC__ and __STATIC__  and added kld_set_link_options() as well as
675 +  the constants to use with it.  Radar bug #3270588.
676 +
677 +Changes for the 5.12 release (the cctools-468 release):
678 +- Added some comments to <mach-o/ppc/reloc.h> to describe the new use of the
679 +  previously unused value 3 for r_length to mean that the conditional branch was
680 +  predicted using the Y-bit and the sign of the displacement and opcode.
681 +  Radar bug #3223045.
682 +
683 +Changes for the 5.12 release (the cctools-467 release):
684 +- Added the PPC_RELOC_LO14_SECTDIFF relocation type to <mach-o/ppc/reloc.h>
685 +  to match the PPC_RELOC_LO14 relocation type for load and store double
686 +  instructions using a section difference expression.  Radar bug #3218027.
687 +
688 +Changes for the 5.12 release (the cctools-466 release):
689 +- Added the DYNAMIC_LOOKUP_ORDINAL to <mach-o/nlist.h> and reduced the value of
690 +  MAX_LIBRARY_ORDINAL by one.  This is to allow dynamic flat namespace lookups
691 +  in twolevel namespace images.  Radar bug #3210803.
692 +
693 +Changes for the 5.12 release (the cctools-464 release):
694 +- Fixed a spelling error in <mach-o/loader.h> where "alwasys" should be "always"
695 +  Radar bug #3198288.
696 +- Added the prototype for the SPI NSHasModInitObjectFileImage() to
697 +  <mach-o/dyld.h> .  Radar bug #3196951.
698 +- Made changes to build cleanly with gcc3.3
699 +  - Change the prototype for round() in "stuff/round.h" to used unsigned long
700 +    in the two places it use long.
701 +
702 +Changes for the 5.12 release (the cctools-463 release):
703 +- Changed the prototype of NSGetSectionDataInObjectFileImage() from
704 +    /* not yet implemented */
705 +    extern void * NSGetSectionDataInObjectFileImage(
706 +       NSObjectFileImage objectFileImage,
707 +       const char *segmentName,
708 +       const char *sectionName);
709 +  to the now implemented prototype:
710 +    extern void * NSGetSectionDataInObjectFileImage(
711 +       NSObjectFileImage objectFileImage,
712 +       const char *segmentName,
713 +       unsigned long *size); /* can be NULL */
714 +  Radar bug #3194204.
715 +- Added the constant:
716 +    #define    MH_DYLIB_STUB   0x9     /* shared library stub for static */
717 +                                       /*  linking only, no section contents */
718 +  to <mach-o/loader.h> .  Radar bug #3193744.
719 +
720 +Changes for the 5.12 release (the cctools-462 release):
721 +- Added the constant:
722 +    #define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10
723 +  to <mach-o/dyld.h> and comments to <mach-o/dyld_gdb.h> .  Radar bug #3190599.
724 +
725 +Changes for the 5.12 release (the cctools-461 release):
726 +- Added the constant:
727 +    #define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8
728 +  to <mach-o/dyld.h> .  Radar bug #3183011.
729 +
730 +Changes for the 5.12 release (the cctools-460 release):
731 +- Removed the /* not yet implemented */ comment off of the following prototypes
732 +  in <mach-o/dyld.h> :
733 +    NSSymbolDefinitionCountInObjectFileImage
734 +    NSSymbolDefinitionNameInObjectFileImage
735 +    NSSymbolReferenceCountInObjectFileImage
736 +    NSSymbolReferenceNameInObjectFileImage
737 +    NSIsSymbolDefinedInObjectFileImage
738 +  As there are now implemented.  Radar bug #3179011.
739 +
740 +Changes for the 5.12 release (the cctools-457 release):
741 +- Added ofile_map_from_memory() to "stuff/ofile.h".  This is needed so the
742 +  NSCreateObjectFileImageFromMemory() api can be implemented.  Radar bug
743 +  #3131622.
744 +
745 +Changes for the 5.12 release (the cctools-456 release):
746 +- Picked up the header file <cbt/libsyminfo.h>.  Radar bug 3145742.
747 +
748 +Changes for the 5.12 release (the cctools-448 release):
749 +- Added the N_OPT constant to <mach-o/stabs.h> which is emitted with
750 +  gcc2_compiled and in gcc source.  Radar bug #3104328.
751 +- Added the _dyld_get_image_header_containing_address() SPI prototype to
752 +  <mach-o/dyld.h> (also added the missing _dyld_image_containing_address()
753 +  prototype).  Radar bug #2967928.
754 +
755 +Changes for the 5.12 release (the cctools-447 release):
756 +- Added the _dyld_all_twolevel_modules_prebound() SPI prototype to
757 +  <mach-o/dyld.h>.  Radar bug #3055372.
758 +
759 +Changes for the 5.11 release (the cctools-444 release):
760 +- Added the file <stuff/symbol_list.h> which contains the interface for the
761 +  symbol lists code taken from strip.c.  Now also used by ld(1)'s
762 +  -exported_symbols_list and -unexported_symbols_list options.  Radar bug
763 +  #3083844.
764 +
765  Changes for the 5.11 release (the cctools-439 release):
766  - Added the VEO cputype and its subtypes to <mach/machine.h>.  Radar bug
767    #3068161.
768 Only in include/standalone: CVS
769 diff -rub include/standalone/libsa.h include/standalone/libsa.h
770 --- include/standalone/libsa.h  Tue Apr 30 00:37:19 2002
771 +++ include/standalone/libsa.h  Mon Aug 25 12:56:22 2003
772 @@ -23,13 +23,13 @@
773   */
774  /* Exported API for standalone library */
775  #if !(defined(KLD) && defined(__STATIC__))
776 -#import <mach/mach.h>
777 +#include <mach/mach.h>
778  #else /* defined(KLD) && defined(__STATIC__) */
779  #include <mach/kern_return.h>
780  #endif /* !(defined(KLD) && defined(__STATIC__)) */
781 -#import <mach-o/loader.h>
782 -#import <stdarg.h>
783 -#import <stddef.h>
784 +#include <mach-o/loader.h>
785 +#include <stdarg.h>
786 +#include <stddef.h>
787  
788  #ifndef bcopy
789  #ifdef __OPENSTEP__
790 Only in include/stuff: CVS
791 diff -rub include/stuff/allocate.h include/stuff/allocate.h
792 --- include/stuff/allocate.h    Tue Apr 30 00:37:19 2002
793 +++ include/stuff/allocate.h    Mon Aug 25 13:08:44 2003
794 @@ -21,8 +21,10 @@
795   * 
796   * @APPLE_LICENSE_HEADER_END@
797   */
798 -#if defined(__MWERKS__) && !defined(__private_extern__)
799 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
800  #define __private_extern__ __declspec(private_extern)
801 +#elif ( defined(__linux__) && !defined(__private_extern__) )
802 +#define __private_extern__ extern
803  #endif
804  
805  /* defined in allocate.c */
806 diff -rub include/stuff/arch.h include/stuff/arch.h
807 --- include/stuff/arch.h        Fri Sep  6 18:27:41 2002
808 +++ include/stuff/arch.h        Mon Aug 25 13:10:15 2003
809 @@ -24,15 +24,17 @@
810  #ifndef _STUFF_ARCH_H_
811  #define _STUFF_ARCH_H_
812  
813 -#if defined(__MWERKS__) && !defined(__private_extern__)
814 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
815  #define __private_extern__ __declspec(private_extern)
816 +#elif ( defined(__linux__) && !defined(__private_extern__) )
817 +#define __private_extern__ extern
818  #endif
819  /*
820   * This file contains the current known set of flags and constants for the
821   * known architectures.
822   */
823 -#import <mach/machine.h>
824 -#import <stuff/bytesex.h>
825 +#include <mach/machine.h>
826 +#include <stuff/bytesex.h>
827  
828  /*
829   * The structure describing an architecture flag with the string of the flag
830 diff -rub include/stuff/best_arch.h include/stuff/best_arch.h
831 --- include/stuff/best_arch.h   Tue Apr 30 00:37:19 2002
832 +++ include/stuff/best_arch.h   Mon Aug 25 13:10:13 2003
833 @@ -21,8 +21,10 @@
834   * 
835   * @APPLE_LICENSE_HEADER_END@
836   */
837 -#if defined(__MWERKS__) && !defined(__private_extern__)
838 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
839  #define __private_extern__ __declspec(private_extern)
840 +#elif ( defined(__linux__) && !defined(__private_extern__) )
841 +#define __private_extern__ extern
842  #endif
843  
844  #include <mach/machine.h>
845 diff -rub include/stuff/bool.h include/stuff/bool.h
846 --- include/stuff/bool.h        Tue Apr 30 00:37:19 2002
847 +++ include/stuff/bool.h        Mon Aug 25 12:56:22 2003
848 @@ -25,6 +25,9 @@
849  #ifndef ENUM_DYLD_BOOL
850  #define ENUM_DYLD_BOOL
851  
852 +#define _STDBOOL_H
853 +#undef bool
854 +
855  #define DYLD_BOOL bool
856  
857  #undef FALSE
858 diff -rub include/stuff/breakout.h include/stuff/breakout.h
859 --- include/stuff/breakout.h    Fri Sep  6 18:27:42 2002
860 +++ include/stuff/breakout.h    Mon Aug 25 13:10:12 2003
861 @@ -21,11 +21,13 @@
862   * 
863   * @APPLE_LICENSE_HEADER_END@
864   */
865 -#if defined(__MWERKS__) && !defined(__private_extern__)
866 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
867  #define __private_extern__ __declspec(private_extern)
868 +#elif ( defined(__linux__) && !defined(__private_extern__) )
869 +#define __private_extern__ extern
870  #endif
871  
872 -#import "stuff/ofile.h"
873 +#include "stuff/ofile.h"
874  
875  /*
876   * The input files are broken out in to their object files and then placed in
877 diff -rub include/stuff/bytesex.h include/stuff/bytesex.h
878 --- include/stuff/bytesex.h     Fri Sep  6 18:27:42 2002
879 +++ include/stuff/bytesex.h     Mon Aug 25 13:10:10 2003
880 @@ -25,23 +25,25 @@
881  #ifndef _STUFF_BYTESEX_H_
882  #define _STUFF_BYTESEX_H_
883  
884 -#if defined(__MWERKS__) && !defined(__private_extern__)
885 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
886  #define __private_extern__ __declspec(private_extern)
887 +#elif ( defined(__linux__) && !defined(__private_extern__) )
888 +#define __private_extern__ extern
889  #endif
890  
891 -#import <mach-o/fat.h>
892 -#import <mach-o/loader.h>
893 -#import <mach/m68k/thread_status.h>
894 -#import <mach/ppc/thread_status.h>
895 -#import <mach/m88k/thread_status.h>
896 -#import <mach/i860/thread_status.h>
897 -#import <mach/i386/thread_status.h>
898 -#import <mach/hppa/thread_status.h>
899 -#import <mach/sparc/thread_status.h>
900 -#import <mach-o/nlist.h>
901 -#import <mach-o/reloc.h>
902 -#import <mach-o/ranlib.h>
903 -#import "stuff/bool.h"
904 +#include <mach-o/fat.h>
905 +#include <mach-o/loader.h>
906 +#include <mach/m68k/thread_status.h>
907 +#include <mach/ppc/thread_status.h>
908 +#include <mach/m88k/thread_status.h>
909 +#include <mach/i860/thread_status.h>
910 +#include <mach/i386/thread_status.h>
911 +#include <mach/hppa/thread_status.h>
912 +#include <mach/sparc/thread_status.h>
913 +#include <mach-o/nlist.h>
914 +#include <mach-o/reloc.h>
915 +#include <mach-o/ranlib.h>
916 +#include "stuff/bool.h"
917  
918  enum byte_sex {
919      UNKNOWN_BYTE_SEX,
920 diff -rub include/stuff/errors.h include/stuff/errors.h
921 --- include/stuff/errors.h      Tue Apr 30 00:37:19 2002
922 +++ include/stuff/errors.h      Mon Aug 25 13:09:00 2003
923 @@ -21,11 +21,13 @@
924   * 
925   * @APPLE_LICENSE_HEADER_END@
926   */
927 -#if defined(__MWERKS__) && !defined(__private_extern__)
928 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
929  #define __private_extern__ __declspec(private_extern)
930 +#elif ( defined(__linux__) && !defined(__private_extern__) )
931 +#define __private_extern__ extern
932  #endif
933  
934 -#import "mach/mach.h"
935 +#include "mach/mach.h"
936  
937  /* user defined (imported) */
938  __private_extern__ char *progname;
939 diff -rub include/stuff/execute.h include/stuff/execute.h
940 --- include/stuff/execute.h     Tue Apr 30 00:37:19 2002
941 +++ include/stuff/execute.h     Mon Aug 25 13:10:04 2003
942 @@ -21,8 +21,10 @@
943   * 
944   * @APPLE_LICENSE_HEADER_END@
945   */
946 -#if defined(__MWERKS__) && !defined(__private_extern__)
947 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
948  #define __private_extern__ __declspec(private_extern)
949 +#elif ( defined(__linux__) && !defined(__private_extern__) )
950 +#define __private_extern__ extern
951  #endif
952  
953  /*
954 diff -rub include/stuff/hash_string.h include/stuff/hash_string.h
955 --- include/stuff/hash_string.h Tue Apr 30 00:37:19 2002
956 +++ include/stuff/hash_string.h Mon Aug 25 13:10:32 2003
957 @@ -21,8 +21,10 @@
958   * 
959   * @APPLE_LICENSE_HEADER_END@
960   */
961 -#if defined(__MWERKS__) && !defined(__private_extern__)
962 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
963  #define __private_extern__ __declspec(private_extern)
964 +#elif ( defined(__linux__) && !defined(__private_extern__) )
965 +#define __private_extern__ extern
966  #endif
967  
968  __private_extern__ long hash_string(
969 diff -rub include/stuff/hppa.h include/stuff/hppa.h
970 --- include/stuff/hppa.h        Tue Apr 30 00:37:19 2002
971 +++ include/stuff/hppa.h        Mon Aug 25 13:10:40 2003
972 @@ -21,8 +21,10 @@
973   * 
974   * @APPLE_LICENSE_HEADER_END@
975   */
976 -#if defined(__MWERKS__) && !defined(__private_extern__)
977 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
978  #define __private_extern__ __declspec(private_extern)
979 +#elif ( defined(__linux__) && !defined(__private_extern__) )
980 +#define __private_extern__ extern
981  #endif
982  
983  __private_extern__ void calc_hppa_HILO(
984 diff -rub include/stuff/ofile.h include/stuff/ofile.h
985 --- include/stuff/ofile.h       Fri Sep  6 18:27:42 2002
986 +++ include/stuff/ofile.h       Mon Aug 25 13:10:51 2003
987 @@ -25,21 +25,23 @@
988  #ifndef _STUFF_OFILE_H_
989  #define _STUFF_OFILE_H_
990  
991 -#if defined(__MWERKS__) && !defined(__private_extern__)
992 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
993  #define __private_extern__ __declspec(private_extern)
994 +#elif ( defined(__linux__) && !defined(__private_extern__) )
995 +#define __private_extern__ extern
996  #endif
997  
998 -#import <ar.h>
999 +#include <ar.h>
1000  #ifndef AR_EFMT1
1001  #define        AR_EFMT1        "#1/"           /* extended format #1 */
1002  #endif
1003 -#import <mach-o/loader.h>
1004 +#include <mach-o/loader.h>
1005  #ifdef OFI
1006 -#import <mach-o/dyld.h>
1007 +#include <mach-o/dyld.h>
1008  #endif
1009 -#import "stuff/bytesex.h"
1010 -#import "stuff/bool.h"
1011 -#import "stuff/arch.h"
1012 +#include "stuff/bytesex.h"
1013 +#include "stuff/bool.h"
1014 +#include "stuff/arch.h"
1015  
1016  enum ofile_type {
1017      OFILE_UNKNOWN,
1018 @@ -114,6 +116,18 @@
1019  #else
1020  __private_extern__ enum bool ofile_map(
1021  #endif
1022 +    const char *file_name,
1023 +    const struct arch_flag *arch_flag, /* can be NULL */
1024 +    const char *object_name,           /* can be NULL */
1025 +    struct ofile *ofile,
1026 +    enum bool archives_with_fat_objects);
1027 +#ifdef OFI
1028 +__private_extern__ NSObjectFileImageReturnCode ofile_map_from_memory(
1029 +#else
1030 +__private_extern__ enum bool ofile_map_from_memory(
1031 +#endif
1032 +    char *addr,
1033 +    unsigned long size,
1034      const char *file_name,
1035      const struct arch_flag *arch_flag, /* can be NULL */
1036      const char *object_name,           /* can be NULL */
1037 diff -rub include/stuff/print.h include/stuff/print.h
1038 --- include/stuff/print.h       Tue Apr 30 00:37:19 2002
1039 +++ include/stuff/print.h       Mon Aug 25 13:10:58 2003
1040 @@ -21,11 +21,13 @@
1041   * 
1042   * @APPLE_LICENSE_HEADER_END@
1043   */
1044 -#if defined(__MWERKS__) && !defined(__private_extern__)
1045 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
1046  #define __private_extern__ __declspec(private_extern)
1047 +#elif ( defined(__linux__) && !defined(__private_extern__) )
1048 +#define __private_extern__ extern
1049  #endif
1050  
1051 -#import <stdarg.h>
1052 +#include <stdarg.h>
1053  
1054  __private_extern__ void print(
1055      const char *format, ...)
1056 diff -rub include/stuff/reloc.h include/stuff/reloc.h
1057 --- include/stuff/reloc.h       Tue Apr 30 00:37:19 2002
1058 +++ include/stuff/reloc.h       Mon Aug 25 13:11:02 2003
1059 @@ -21,12 +21,14 @@
1060   * 
1061   * @APPLE_LICENSE_HEADER_END@
1062   */
1063 -#if defined(__MWERKS__) && !defined(__private_extern__)
1064 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
1065  #define __private_extern__ __declspec(private_extern)
1066 +#elif ( defined(__linux__) && !defined(__private_extern__) )
1067 +#define __private_extern__ extern
1068  #endif
1069  
1070 -#import <mach/machine.h>
1071 -#import "stuff/bool.h"
1072 +#include <mach/machine.h>
1073 +#include "stuff/bool.h"
1074  
1075  __private_extern__ unsigned long reloc_pair_r_type(
1076      cpu_type_t cputype);
1077 diff -rub include/stuff/round.h include/stuff/round.h
1078 --- include/stuff/round.h       Tue Apr 30 00:37:19 2002
1079 +++ include/stuff/round.h       Mon Aug 25 13:11:06 2003
1080 @@ -21,13 +21,15 @@
1081   * 
1082   * @APPLE_LICENSE_HEADER_END@
1083   */
1084 -#if defined(__MWERKS__) && !defined(__private_extern__)
1085 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
1086  #define __private_extern__ __declspec(private_extern)
1087 +#elif ( defined(__linux__) && !defined(__private_extern__) )
1088 +#define __private_extern__ extern
1089  #endif
1090  
1091  /*
1092   * round() rounds v to a multiple of r.
1093   */
1094 -__private_extern__ long round(
1095 -    long v,
1096 +__private_extern__ unsigned long round(
1097 +    unsigned long v,
1098      unsigned long r);
1099 Only in include/stuff: symbol_list.h
1100 diff -rub include/stuff/vm_flush_cache.h include/stuff/vm_flush_cache.h
1101 --- include/stuff/vm_flush_cache.h      Tue Apr 30 00:37:19 2002
1102 +++ include/stuff/vm_flush_cache.h      Mon Aug 25 13:11:15 2003
1103 @@ -21,11 +21,13 @@
1104   * 
1105   * @APPLE_LICENSE_HEADER_END@
1106   */
1107 -#if defined(__MWERKS__) && !defined(__private_extern__)
1108 +#if ( defined(__MWERKS__) && !defined(__private_extern__) )
1109  #define __private_extern__ __declspec(private_extern)
1110 +#elif ( defined(__linux__) && !defined(__private_extern__) )
1111 +#define __private_extern__ extern
1112  #endif
1113  
1114 -#import <mach/mach.h>
1115 +#include <mach/mach.h>
1116  __private_extern__ kern_return_t vm_flush_cache(
1117      mach_port_t target_task,
1118      vm_address_t address,
1119 Only in include/sys: CVS