home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / usr / local / include / mach-o / sarld.h < prev   
Encoding:
C/C++ Source or Header  |  2001-09-14  |  3.9 KB  |  92 lines

  1. /*
  2.  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
  3.  *
  4.  * @APPLE_LICENSE_HEADER_START@
  5.  * 
  6.  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
  7.  * Reserved.  This file contains Original Code and/or Modifications of
  8.  * Original Code as defined in and that are subject to the Apple Public
  9.  * Source License Version 1.1 (the "License").  You may not use this file
  10.  * except in compliance with the License.  Please obtain a copy of the
  11.  * License at http://www.apple.com/publicsource and read it before using
  12.  * this file.
  13.  * 
  14.  * The Original Code and all software distributed under the License are
  15.  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  16.  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  17.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  18.  * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
  19.  * License for the specific language governing rights and limitations
  20.  * under the License.
  21.  * 
  22.  * @APPLE_LICENSE_HEADER_END@
  23.  */
  24. #import <mach-o/nlist.h>
  25. /*
  26.  * sa_rld() loads the specified object in memory against the specified
  27.  * base file in memory.  The output is placed in memory starting at
  28.  * the value of the parameter workmem_addr and the size of the memory
  29.  * used for the output returned indirectly through workmem_size.
  30.  * Initially *workmem_size is the size of the working memory.
  31.  */
  32. typedef int sa_rld_t(
  33. char           *basefile_name,  /* base file name */
  34. struct mach_header *basefile_addr,  /* mach header of the base file */
  35.  
  36. char               *object_name,    /* name of the object to load */
  37. char               *object_addr,    /* addr of the object in memory to load */
  38. unsigned long       object_size,    /* size of the object in memory to load */
  39.  
  40. char               *workmem_addr,   /* address of working memory */
  41. unsigned long      *workmem_size,   /* size of working memory (in/out) */
  42.  
  43. char               *error_buf_addr, /* address of error message buffer */
  44. unsigned long       error_buf_size, /* size of error message buffer */
  45.  
  46. char               *malloc_addr,    /* address to use for initializing malloc */
  47. unsigned long       malloc_len);    /* length to use for same */
  48.  
  49. /*
  50.  * sa_rld_with_symtab() is the same as sa_rld() except it passed in a pointer
  51.  * to the symbol table, its size and a pointer to the string table and its
  52.  * size.  Rather getting the the symbol table off of the mach header and the
  53.  * link edit segment.
  54.  */
  55. typedef int sa_rld_with_symtab_t(
  56. char           *basefile_name,  /* base file name */
  57. struct mach_header *basefile_addr,  /* mach header of the base file */
  58.  
  59. char               *object_name,    /* name of the object to load */
  60. char               *object_addr,    /* addr of the object in memory to load */
  61. unsigned long       object_size,    /* size of the object in memory to load */
  62.  
  63. char               *workmem_addr,   /* address of working memory */
  64. unsigned long      *workmem_size,   /* size of working memory (in/out) */
  65.  
  66. char               *error_buf_addr, /* address of error message buffer */
  67. unsigned long       error_buf_size, /* size of error message buffer */
  68.  
  69. char               *malloc_addr,    /* address to use for initializing malloc */
  70. unsigned long       malloc_len,     /* length to use for same */
  71.  
  72. struct nlist       *symtab,         /* pointer to the symbol table */
  73. unsigned long      nsyms,           /* number of symbols */
  74.  
  75. char               *strtab,         /* pointer to the string table */
  76. unsigned long      strsize);        /* sizeof the string table */
  77.  
  78. #ifdef SA_RLD
  79. extern sa_rld_t sa_rld;
  80. extern sa_rld_with_symtab_t sa_rld_with_symtab;
  81.  
  82. /*
  83.  * These two variables are internal to sarld and not part of the external sarld
  84.  * API.  These are set in sa_rld() and used in layout_segments() as the place
  85.  * to put the output in memory.
  86.  */
  87. __private_extern__ char         *sa_rld_output_addr;
  88. __private_extern__ unsigned long sa_rld_output_size;
  89. #endif /* SA_RLD */
  90.  
  91.  
  92.