Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.8 KiB

  1. /***
  2. *crt0init.c - Initialization segment declarations.
  3. *
  4. * Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Do initialization segment declarations.
  8. *
  9. *Notes:
  10. * In the 16-bit C world, the X*B and X*E segments were empty except for
  11. * a label. This will not work with COFF since COFF throws out empty
  12. * sections. Therefore we must put a zero value in them. (Zero because
  13. * the routine to traverse the initializers will skip over zero entries.)
  14. *
  15. *Revision History:
  16. * 03-19-92 SKS Module created.
  17. * 03-24-92 SKS Added MIPS support (NO_UNDERSCORE)
  18. * 08-06-92 SKS Revised to use new section names and macros
  19. * 10-19-93 SKS Add .DiRECTiVE section for MIPS, too!
  20. * 10-28-93 GJF Rewritten in C
  21. * 10-28-94 SKS Add user32.lib as a default library
  22. * 02-27-95 CFW Remove user32.lib as a default library
  23. * 06-22-95 CFW Add /disallowlib directives.
  24. * 04-28-99 PML Wrap __declspec(allocate()) in _CRTALLOC macro.
  25. * 03-27-01 PML .CRT$XI funcs now return an error status (vs7#231220)
  26. * 07-15-01 PML Remove all ALPHA, MIPS, and PPC code
  27. *
  28. *******************************************************************************/
  29. #include <sect_attribs.h>
  30. #include <stdio.h>
  31. #include <internal.h>
  32. #pragma data_seg(".CRT$XIA")
  33. _CRTALLOC(".CRT$XIA") _PIFV __xi_a[] = { NULL };
  34. #pragma data_seg(".CRT$XIZ")
  35. _CRTALLOC(".CRT$XIZ") _PIFV __xi_z[] = { NULL };
  36. #pragma data_seg(".CRT$XCA")
  37. _CRTALLOC(".CRT$XCA") _PVFV __xc_a[] = { NULL };
  38. #pragma data_seg(".CRT$XCZ")
  39. _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[] = { NULL };
  40. #pragma data_seg(".CRT$XPA")
  41. _CRTALLOC(".CRT$XPA") _PVFV __xp_a[] = { NULL };
  42. #pragma data_seg(".CRT$XPZ")
  43. _CRTALLOC(".CRT$XPZ") _PVFV __xp_z[] = { NULL };
  44. #pragma data_seg(".CRT$XTA")
  45. _CRTALLOC(".CRT$XTA") _PVFV __xt_a[] = { NULL };
  46. #pragma data_seg(".CRT$XTZ")
  47. _CRTALLOC(".CRT$XTZ") _PVFV __xt_z[] = { NULL };
  48. #pragma data_seg() /* reset */
  49. #if defined(_M_IA64) || defined(_M_AMD64)
  50. #pragma comment(linker, "/merge:.CRT=.rdata")
  51. #else
  52. #ifdef NT_BUILD
  53. #pragma comment(linker, "/merge:.CRT=.rdata")
  54. #else
  55. #pragma comment(linker, "/merge:.CRT=.data")
  56. #endif
  57. #endif
  58. #pragma comment(linker, "/defaultlib:kernel32.lib")
  59. #if !(!defined(_MT) && !defined(_DEBUG))
  60. #pragma comment(linker, "/disallowlib:libc.lib")
  61. #endif
  62. #if !(!defined(_MT) && defined(_DEBUG))
  63. #pragma comment(linker, "/disallowlib:libcd.lib")
  64. #endif
  65. #if !( defined(_MT) && !defined(_DEBUG))
  66. #pragma comment(linker, "/disallowlib:libcmt.lib")
  67. #endif
  68. #if !( defined(_MT) && defined(_DEBUG))
  69. #pragma comment(linker, "/disallowlib:libcmtd.lib")
  70. #endif
  71. #pragma comment(linker, "/disallowlib:msvcrt.lib")
  72. #pragma comment(linker, "/disallowlib:msvcrtd.lib")