loadLib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:4k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* loadLib.h - object module loader library header */
  2. /* Copyright 1984-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01v,08may02,fmk  - add LOAD_COMMON flags
  7.                  - move non-public declarations for loadModuleAtSym(),
  8.                  loadModuleGet(),addSegNames() and loadSegmentsAllocate()
  9.                  to loadLibP.h
  10. 01u,30oct96,elp  Added LOAD_LOADED_BY_TGTSVR flag + syncLoadRtn function
  11.  pointer.
  12. 01t,01oct96,elp  added LOAD_MODULE_INFO_ONLY flag (SPR# 6775).
  13. 01s,22sep92,rrr  added support for c++
  14. 01r,22jul92,jmm  removed NO_TRACK_MODULE define
  15.                  moved SEG_INFO here from various loaders
  16.  added prototypes for addSegNames and loadSegmentsAllocate
  17. 01q,21jul92,jmm  added HIDDEN_MODULE define
  18. 01p,18jun92,ajm  made object module independant
  19. 01o,26may92,rrr  the tree shuffle
  20. 01n,14may92,ajm  rewritten for object module independent loadLib
  21.   updated copyright
  22. 01m,04oct91,rrr  passed through the ansification filter
  23.   -fixed #else and #endif
  24.   -changed copyright notice
  25. 01l,02aug91,ajm  added mips specific error entries
  26. 01k,24mar91,del  added I960 defines.
  27. 01j,05oct90,dnw  deleted private routines.
  28. 01i,05oct90,shl  added ANSI function prototypes.
  29.                  made #endif ANSI style.
  30.                  added copyright notice.
  31. 01h,07aug90,shl  added INCloadLibh to #endif.
  32. 01g,05jun88,dnw  changed ldLib to loadLib.
  33. 01f,07aug87,ecs  added LD_NO_ADDRESS.
  34. 01e,24dec86,gae  changed stsLib.h to vwModNum.h.
  35. 01d,10aug84,dnw  removed unused status code: S_ldLib_UNDEFINED_SYMBOL.
  36. 01c,07aug84,ecs  added include of stsLib.h
  37.  added status codes
  38.  added inclusion test
  39. 01b,29jun84,ecs  changed values of *_SYMBOLS so default would be GLOBAL_SYMBOLS
  40. 01a,27apr84,dnw  written
  41. */
  42. #ifndef __INCloadLibh
  43. #define __INCloadLibh
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. #include "vwModNum.h"
  48. #include "symLib.h"
  49. #include "moduleLib.h"
  50. /* status codes */
  51. #define S_loadLib_ROUTINE_NOT_INSTALLED (M_loadLib | 1)
  52. #define S_loadLib_TOO_MANY_SYMBOLS (M_loadLib | 2)
  53. #define NO_SYMBOLS      -1
  54. #define GLOBAL_SYMBOLS  0
  55. #define ALL_SYMBOLS     1
  56. /* new load flags */
  57. #define LOAD_NO_SYMBOLS         2
  58. #define LOAD_LOCAL_SYMBOLS 4
  59. #define LOAD_GLOBAL_SYMBOLS 8
  60. #define LOAD_ALL_SYMBOLS (LOAD_LOCAL_SYMBOLS | LOAD_GLOBAL_SYMBOLS)
  61. #define HIDDEN_MODULE         16 /* Don't display module from moduleShow() */
  62. #define LOAD_COMMON_MATCH_NONE 0x100 /* Only alloc, no search (default) */
  63. #define LOAD_COMMON_MATCH_USER 0x200 /* Core file excluded from search  */
  64. #define LOAD_COMMON_MATCH_ALL 0x400 /* Core file included in search    */
  65. #define LOAD_MODULE_INFO_ONLY 0x1000000 /* host/target symtbls sync */
  66. #define LOAD_LOADED_BY_TGTSVR 0x2000000 /* host/target symtbls sync */
  67. #define LD_NO_ADDRESS   ((char *) NONE)
  68. /* data structures */
  69. extern FUNCPTR loadRoutine;
  70. extern FUNCPTR syncLoadRtn;
  71. typedef struct
  72.     {
  73.     char * addrText; /* text segment address */
  74.     char * addrData; /* data segment address */
  75.     char * addrBss; /* bss segment address */
  76.     UINT   sizeText; /* text segment size */
  77.     UINT   sizeProtectedText; /* protected text segment size */
  78.     UINT   sizeData; /* data segment size */
  79.     UINT   sizeBss; /* bss segment size */
  80.     int    flagsText; /* text flags for module */
  81.     int    flagsData; /* data flags for module */
  82.     int    flagsBss; /* bss flags for module */
  83.     } SEG_INFO;
  84. /* function declarations */
  85. extern MODULE_ID loadModule (int fd, int symFlag);
  86. extern MODULE_ID loadModuleAt (int fd, int symFlag, char **ppText,
  87.        char **ppData, char **ppBss);
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91. #endif /* __INCloadLibh */