1 Only in include/: 2.0Compat
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
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
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 \
16 mach-o/hppa/swap.h mach-o/hppa/reloc.h \
17 mach-o/m88k/swap.h mach-o/m88k/reloc.h \
19 - mach-o/sparc/swap.h mach-o/sparc/reloc.h
20 + mach-o/sparc/swap.h mach-o/sparc/reloc.h \
23 # Note that OTHER_SRCS do NOT get installed
24 OTHER_SRCS = notes gnu/symseg.h \
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
32 ENCUMBERED_SRCS = gnu/a.out.h gnu/exec.h
34 # Note that MISSING_SRCS are those may not be on all build machines
36 ENCUMBERED_SRC_FILES = $(SRC_FILES) $(ENCUMBERED_SRCS)
42 gnutar cf - $(ENCUMBERED_SRC_FILES) | (cd $(SRCROOT); gnutar xf -)
45 install -c -m 444 ${IFLAGS} bool.h \
46 ${DSTROOT}${$(RC_OS)_LOCINCDIR}/dyld
48 + install -c -m 444 ${IFLAGS} libsyminfo.h \
49 + ${DSTROOT}${$(RC_OS)_LOCINCDIR}/cbt
52 $(MKDIRS) ${DSTROOT}${$(RC_OS)_INCDIR}/mach-o/i386
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
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
70 -#import <architecture/i386/sel.h>
71 +#include <architecture/i386/sel.h>
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
82 -#import <architecture/i386/sel.h>
83 +#include <architecture/i386/sel.h>
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
92 #ifndef _ARCH_M88K_FP_REGS_H_
93 #define _ARCH_M88K_FP_REGS_H_
95 -#import <architecture/m88k/reg_help.h>
96 +#include <architecture/m88k/reg_help.h>
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
104 #ifndef _ARCH_M88K_REG_HELP_H_
105 #define _ARCH_M88K_REG_HELP_H_
107 -#import <architecture/nrw/reg_help.h>
108 +#include <architecture/nrw/reg_help.h>
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
128 #ifndef _MACH_M88K_THREAD_STATE_
129 #define _MACH_M88K_THREAD_STATE_
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>
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
143 #ifndef _MACH_MACHINE_H_
144 #define _MACH_MACHINE_H_
146 -#import <mach/machine/vm_types.h>
147 -#import <mach/boolean.h>
148 +#include <mach/machine/vm_types.h>
149 +#include <mach/boolean.h>
152 * For each host, there is a maximum possible number of
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)
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
168 * The high level NS... API.
171 -/* Object file image api */
172 +/* Object file image API */
174 NSObjectFileImageFailure, /* for this a message is printed on stderr */
175 NSObjectFileImageSuccess,
177 extern enum DYLD_BOOL NSDestroyObjectFileImage(
178 NSObjectFileImage objectFileImage);
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
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 */
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
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);
225 typedef void * NSModule;
226 extern const char * NSNameOfModule(
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
235 /* limited implementation, only modules loaded with NSLinkModule() can be
238 NSObjectFileImage newObjectFileImage,
239 unsigned long options);
243 typedef void * NSSymbol;
244 extern enum DYLD_BOOL NSIsSymbolNameDefined(
245 const char *symbolName);
247 extern NSModule NSModuleForSymbol(
250 -/* error handling api */
251 +/* error handling API */
253 NSLinkEditFileAccessError,
254 NSLinkEditFileFormatError,
256 extern void NSInstallLinkEditErrorHandlers(
257 NSLinkEditErrorHandlers *handlers);
261 extern enum DYLD_BOOL NSAddLibrary(
262 const char *pathName);
263 extern enum DYLD_BOOL NSAddLibraryWithSearching(
264 @@ -273,10 +273,18 @@
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);
274 extern void _dyld_moninit(
275 void (*monaddition)(char *lowpc, char *highpc));
276 extern enum DYLD_BOOL _dyld_launched_prebound(
278 +/* SPI first appeared in Mac OS X 10.3 */
279 +extern enum DYLD_BOOL _dyld_all_twolevel_modules_prebound(
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
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
296 * start with a structure containing the following fields:
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
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
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
324 * @APPLE_LICENSE_HEADER_END@
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>
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
340 * @APPLE_LICENSE_HEADER_END@
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>
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
353 __private_extern__ long kld_load_basefile(
354 const char *base_filename);
356 -__private_extern__ long kld_load_basefile_from_memory(
357 - const char *base_filename,
361 /* Note: this takes only one object file name */
362 __private_extern__ long kld_load(
363 struct mach_header **header_addr,
365 #endif /* __DYNAMIC__ */
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
375 #endif /* __STATIC__ */
377 +__private_extern__ long kld_load_basefile_from_memory(
378 + const char *base_filename,
382 __private_extern__ long kld_unload_all(
383 long deallocate_sets);
387 __private_extern__ void kld_address_func(
388 unsigned long (*func)(unsigned long size, unsigned long headers_size));
390 +#define KLD_STRIP_ALL 0x00000000
391 +#define KLD_STRIP_NONE 0x00000001
393 +__private_extern__ void kld_set_link_options(
394 + unsigned long link_options);
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
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 */
412 /* Constants for the flags field of the mach_header */
413 #define MH_NOUNDEFS 0x1 /* the object file has no undefined
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
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 */
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)*/
444 + * load a dynamically linked shared library that is allowed to be missing
445 + * (all symbols are weak imported).
447 #define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
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
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
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.
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
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:
490 * file is part of the module.
491 * reference symbol table - is the defined and undefined external symbols
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
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).
505 unsigned long ilocalsym; /* index to local symbols */
506 unsigned long nlocalsym; /* number of local symbols */
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.
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.
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.
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
540 * @APPLE_LICENSE_HEADER_END@
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>
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
555 * @APPLE_LICENSE_HEADER_END@
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>
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
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.
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
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
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.
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.
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.
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,
628 + PPC_RELOC_LO14_SECTDIFF
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
634 #ifndef _MACHO_RLD_H_
635 #define _MACHO_RLD_H_
637 -#include <streams/streams.h>
638 +//~ #include <streams/streams.h>
639 #include <mach-o/loader.h>
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
648 * @APPLE_LICENSE_HEADER_END@
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>
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
745 +Changes for the 5.12 release (the cctools-456 release):
746 +- Picked up the header file <cbt/libsyminfo.h>. Radar bug 3145742.
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.
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.
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
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
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
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>
784 +#include <mach-o/loader.h>
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
796 * @APPLE_LICENSE_HEADER_END@
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
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
810 #ifndef _STUFF_ARCH_H_
811 #define _STUFF_ARCH_H_
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
820 * This file contains the current known set of flags and constants for the
821 * known architectures.
823 -#import <mach/machine.h>
824 -#import <stuff/bytesex.h>
825 +#include <mach/machine.h>
826 +#include <stuff/bytesex.h>
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
835 * @APPLE_LICENSE_HEADER_END@
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
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
849 #ifndef ENUM_DYLD_BOOL
850 #define ENUM_DYLD_BOOL
855 #define DYLD_BOOL bool
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
863 * @APPLE_LICENSE_HEADER_END@
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
872 -#import "stuff/ofile.h"
873 +#include "stuff/ofile.h"
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
881 #ifndef _STUFF_BYTESEX_H_
882 #define _STUFF_BYTESEX_H_
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
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"
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
925 * @APPLE_LICENSE_HEADER_END@
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
934 -#import "mach/mach.h"
935 +#include "mach/mach.h"
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
944 * @APPLE_LICENSE_HEADER_END@
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
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
959 * @APPLE_LICENSE_HEADER_END@
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
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
974 * @APPLE_LICENSE_HEADER_END@
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
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
988 #ifndef _STUFF_OFILE_H_
989 #define _STUFF_OFILE_H_
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
1001 #define AR_EFMT1 "#1/" /* extended format #1 */
1003 -#import <mach-o/loader.h>
1004 +#include <mach-o/loader.h>
1006 -#import <mach-o/dyld.h>
1007 +#include <mach-o/dyld.h>
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"
1018 @@ -114,6 +116,18 @@
1020 __private_extern__ enum bool ofile_map(
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);
1028 +__private_extern__ NSObjectFileImageReturnCode ofile_map_from_memory(
1030 +__private_extern__ enum bool ofile_map_from_memory(
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
1042 * @APPLE_LICENSE_HEADER_END@
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
1052 +#include <stdarg.h>
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
1061 * @APPLE_LICENSE_HEADER_END@
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
1070 -#import <mach/machine.h>
1071 -#import "stuff/bool.h"
1072 +#include <mach/machine.h>
1073 +#include "stuff/bool.h"
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
1082 * @APPLE_LICENSE_HEADER_END@
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
1092 * round() rounds v to a multiple of r.
1094 -__private_extern__ long round(
1096 +__private_extern__ unsigned long round(
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
1105 * @APPLE_LICENSE_HEADER_END@
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
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