⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gcconfig.h

📁 this gcc-g++-3.3.1.tar.gz is a source file of gcc, you can learn more about gcc through this codes f
💻 H
📖 第 1 页 / 共 4 页
字号:
 *		Segmentation violation or Bus error is signalled.  Round that *		to the nearest plausible page boundary, and use that instead *		of STACKBOTTOM. * * Gustavo Rodriguez-Rivera points out that on most (all?) Unix machines, * the value of environ is a pointer that can serve as STACKBOTTOM. * I expect that HEURISTIC2 can be replaced by this approach, which * interferes far less with debugging.  However it has the disadvantage * that it's confused by a putenv call before the collector is initialized. * This could be dealt with by intercepting putenv ... * * If no expression for STACKBOTTOM can be found, and neither of the above * heuristics are usable, the collector can still be used with all of the above * undefined, provided one of the following is done: * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s) *    without reference to STACKBOTTOM.  This is appropriate for use in *    conjunction with thread packages, since there will be multiple stacks. *    (Allocating thread stacks in the heap, and treating them as ordinary *    heap data objects is also possible as a last resort.  However, this is *    likely to introduce significant amounts of excess storage retention *    unless the dead parts of the thread stacks are periodically cleared.) * 2) Client code may set GC_stackbottom before calling any GC_ routines. *    If the author of the client code controls the main program, this is *    easily accomplished by introducing a new main program, setting *    GC_stackbottom to the address of a local variable, and then calling *    the original main program.  The new main program would read something *    like: * *		# include "gc_private.h" * *		main(argc, argv, envp) *		int argc; *		char **argv, **envp; *		{ *		    int dummy; * *		    GC_stackbottom = (ptr_t)(&dummy); *		    return(real_main(argc, argv, envp)); *		} * * * Each architecture may also define the style of virtual dirty bit * implementation to be used: *   MPROTECT_VDB: Write protect the heap and catch faults. *   PROC_VDB: Use the SVR4 /proc primitives to read dirty bits. * * An architecture may define DYNAMIC_LOADING if dynamic_load.c * defined GC_register_dynamic_libraries() for the architecture. * * An architecture may define PREFETCH(x) to preload the cache with *x. * This defaults to a no-op. * * PREFETCH_FOR_WRITE(x) is used if *x is about to be written. * * An architecture may also define CLEAR_DOUBLE(x) to be a fast way to * clear the two words at GC_malloc-aligned address x.  By default, * word stores of 0 are used instead. *//* If we are using a recent version of gcc, we can use __builtin_unwind_init() * to push the relevant registers onto the stack.  This generally makes * USE_GENERIC_PUSH_REGS the preferred approach for marking from registers. */# if defined(__GNUC__) && ((__GNUC__ >= 3) || \			   (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))#   define HAVE_BUILTIN_UNWIND_INIT# endif# define STACK_GRAN 0x1000000# ifdef M68K#   define MACH_TYPE "M68K"#   define ALIGNMENT 2#   ifdef OPENBSD#	define OS_TYPE "OPENBSD"#	define HEURISTIC2	extern char etext[];#	define DATASTART ((ptr_t)(etext))#   endif#   ifdef NETBSD#	define OS_TYPE "NETBSD"#	define HEURISTIC2	extern char etext[];#	define DATASTART ((ptr_t)(etext))#   endif#   ifdef LINUX#       define OS_TYPE "LINUX"#       define STACKBOTTOM ((ptr_t)0xf0000000)/* #       define MPROTECT_VDB - Reported to not work  9/17/01 */#       ifdef __ELF__#            define DYNAMIC_LOADING#	     include <features.h>#	     if defined(__GLIBC__)&& __GLIBC__>=2#              define LINUX_DATA_START#	     else /* !GLIBC2 */               extern char **__environ;#              define DATASTART ((ptr_t)(&__environ))                             /* hideous kludge: __environ is the first */                             /* word in crt0.o, and delimits the start */                             /* of the data segment, no matter which   */                             /* ld options were passed through.        */                             /* We could use _etext instead, but that  */                             /* would include .rodata, which may       */                             /* contain large read-only data tables    */                             /* that we'd rather not scan.             */#	     endif /* !GLIBC2 */             extern int _end[];#            define DATAEND (_end)#       else             extern int etext[];#            define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))#       endif#   endif#   ifdef SUNOS4#	define OS_TYPE "SUNOS4"	extern char etext[];#	define DATASTART ((ptr_t)((((word) (etext)) + 0x1ffff) & ~0x1ffff))#	define HEURISTIC1	/* differs	*/#	define DYNAMIC_LOADING#   endif#   ifdef HP#	define OS_TYPE "HP"	extern char etext[];#       define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))#       define STACKBOTTOM ((ptr_t) 0xffeffffc)			      /* empirically determined.  seems to work. */#  	include <unistd.h>#	define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)#   endif#   ifdef SYSV#	define OS_TYPE "SYSV"	extern etext[];#   	define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \				   & ~0x3fffff) \				  +((word)etext & 0x1fff))	/* This only works for shared-text binaries with magic number 0413.	   The other sorts of SysV binaries put the data at the end of the text,	   in which case the default of etext would work.  Unfortunately,	   handling both would require having the magic-number available.	   	   		-- Parag	   */#	define STACKBOTTOM ((ptr_t)0xFFFFFFFE)			/* The stack starts at the top of memory, but   */			/* 0x0 cannot be used as setjump_test complains */			/* that the stack direction is incorrect.  Two  */			/* bytes down from 0x0 should be safe enough.   */			/* 		--Parag				*/#   	include <sys/mmu.h>#	define GETPAGESIZE() PAGESIZE	/* Is this still right? */#   endif#   ifdef AMIGA#	define OS_TYPE "AMIGA" 	    	/* STACKBOTTOM and DATASTART handled specially	*/ 	    	/* in os_dep.c					*/# 	define DATAEND	/* not needed */#	define GETPAGESIZE() 4096#   endif#   ifdef MACOS#     ifndef __LOWMEM__#     include <LowMem.h>#     endif#     define OS_TYPE "MACOS"			/* see os_dep.c for details of global data segments. */#     define STACKBOTTOM ((ptr_t) LMGetCurStackBase())#     define DATAEND	/* not needed */#     define GETPAGESIZE() 4096#   endif#   ifdef NEXT#	define OS_TYPE "NEXT"#	define DATASTART ((ptr_t) get_etext())#	define STACKBOTTOM ((ptr_t) 0x4000000)#	define DATAEND	/* not needed */#   endif# endif# ifdef POWERPC#   define MACH_TYPE "POWERPC"#   ifdef MACOS#     define ALIGNMENT 2  /* Still necessary?  Could it be 4?	*/#     ifndef __LOWMEM__#     include <LowMem.h>#     endif#     define OS_TYPE "MACOS"			/* see os_dep.c for details of global data segments. */#     define STACKBOTTOM ((ptr_t) LMGetCurStackBase())#     define DATAEND  /* not needed */#   endif#   ifdef LINUX#     define ALIGNMENT 4	/* Guess.  Can someone verify?	*/				/* This was 2, but that didn't sound right. */#     define OS_TYPE "LINUX"#     define DYNAMIC_LOADING#     define LINUX_STACKBOTTOM	/* Stack usually starts at 0x80000000 */#     define LINUX_DATA_START      extern int _end[];#     define DATAEND (_end)#   endif#   ifdef MACOSX      /* There are reasons to suspect this may not be reliable. 	*/#     define ALIGNMENT 4#     define OS_TYPE "MACOSX"#     define DATASTART ((ptr_t) get_etext())#     define STACKBOTTOM ((ptr_t) 0xc0000000)#     define DATAEND	/* not needed */#     undef MPROTECT_VDB#     include <unistd.h>#     define GETPAGESIZE() getpagesize()#   endif#   ifdef NETBSD#     define ALIGNMENT 4#     define OS_TYPE "NETBSD"#     define HEURISTIC2      extern char etext[];#     define DATASTART GC_data_start#     define DYNAMIC_LOADING#   endif#   ifdef NOSYS#     define ALIGNMENT 4#     define OS_TYPE "NOSYS"      extern void __end[], __dso_handle[];#     define DATASTART (__dso_handle)  /* OK, that's ugly.  */#     define DATAEND (__end)	/* Stack starts at 0xE0000000 for the simulator.  */#     undef STACK_GRAN#     define STACK_GRAN 0x10000000#     define HEURISTIC1#   endif# endif# ifdef VAX#   define MACH_TYPE "VAX"#   define ALIGNMENT 4	/* Pointers are longword aligned by 4.2 C compiler */    extern char etext[];#   define DATASTART ((ptr_t)(etext))#   ifdef BSD#	define OS_TYPE "BSD"#	define HEURISTIC1			/* HEURISTIC2 may be OK, but it's hard to test. */#   endif#   ifdef ULTRIX#	define OS_TYPE "ULTRIX"#	define STACKBOTTOM ((ptr_t) 0x7fffc800)#   endif# endif# ifdef RT#   define MACH_TYPE "RT"#   define ALIGNMENT 4#   define DATASTART ((ptr_t) 0x10000000)#   define STACKBOTTOM ((ptr_t) 0x1fffd800)# endif# ifdef SPARC#   define MACH_TYPE "SPARC"#   if defined(__arch64__) || defined(__sparcv9)#     define ALIGNMENT 8#     define CPP_WORDSZ 64#     define ELF_CLASS ELFCLASS64#   else#     define ALIGNMENT 4	/* Required by hardware	*/#     define CPP_WORDSZ 32#   endif#   define ALIGN_DOUBLE#   ifdef SUNOS5#	define OS_TYPE "SUNOS5"	extern int _etext[];	extern int _end[];	extern char * GC_SysVGetDataStart();#       define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext)#	define DATAEND (_end)#	if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)#	    define USE_MMAP	    /* Otherwise we now use calloc.  Mmap may result in the	*/	    /* heap interleaved with thread stacks, which can result in	*/	    /* excessive blacklisting.  Sbrk is unusable since it	*/	    /* doesn't interact correctly with the system malloc.	*/#	endif#       ifdef USE_MMAP#         define HEAP_START (ptr_t)0x40000000#       else#	  define HEAP_START DATAEND#       endif#	define PROC_VDB/*	HEURISTIC1 reportedly no longer works under 2.7.  		*//*  	HEURISTIC2 probably works, but this appears to be preferable.	*//*	Apparently USRSTACK is defined to be USERLIMIT, but in some	*//* 	installations that's undefined.  We work around this with a	*//*	gross hack:							*/#       include <sys/vmparam.h>#	ifdef USERLIMIT	  /* This should work everywhere, but doesn't.	*/#	  define STACKBOTTOM USRSTACK#       else#	  define HEURISTIC2#       endif#	include <unistd.h>#       define GETPAGESIZE()  sysconf(_SC_PAGESIZE)		/* getpagesize() appeared to be missing from at least one */		/* Solaris 5.4 installation.  Weird.			  */#	define DYNAMIC_LOADING#   endif#   ifdef SUNOS4#	define OS_TYPE "SUNOS4"	/* [If you have a weak stomach, don't read this.]		*/	/* We would like to use:					*//* #       define DATASTART ((ptr_t)((((word) (etext)) + 0x1fff) & ~0x1fff)) */	/* This fails occasionally, due to an ancient, but very 	*/	/* persistent ld bug.  etext is set 32 bytes too high.		*/	/* We instead read the text segment size from the a.out		*/	/* header, which happens to be mapped into our address space	*/	/* at the start of the text segment.  The detective work here	*/	/* was done by Robert Ehrlich, Manuel Serrano, and Bernard	*/	/* Serpette of INRIA.						*/	/* This assumes ZMAGIC, i.e. demand-loadable executables.	*/#	define TEXTSTART 0x2000#       define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))#	define MPROTECT_VDB#	define HEURISTIC1# 	define DYNAMIC_LOADING#   endif#   ifdef DRSNX#	define OS_TYPE "DRSNX"	extern char * GC_SysVGetDataStart();	extern int etext[];#       define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, etext)#	define MPROTECT_VDB#       define STACKBOTTOM ((ptr_t) 0xdfff0000)#	define DYNAMIC_LOADING#   endif#   ifdef LINUX#     define OS_TYPE "LINUX"#     ifdef __ELF__#       define DYNAMIC_LOADING#     else          Linux Sparc/a.out not supported#     endif      extern int _end[];      extern int _etext[];#     define DATAEND (_end)#     define SVR4#     ifdef __arch64__	/* libc_stack_end is not set reliably for sparc64 */#       define STACKBOTTOM ((ptr_t) 0x80000000000)#	define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, _etext)#     else#       define LINUX_STACKBOTTOM#	define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext)#     endif#   endif#   ifdef OPENBSD#     define OS_TYPE "OPENBSD"#     define STACKBOTTOM ((ptr_t) 0xf8000000)      extern int etext[];#     define DATASTART ((ptr_t)(etext))#   endif#   ifdef NETBSD#     define OS_TYPE "NETBSD"#     define HEURISTIC2#     ifdef __ELF__#	define DATASTART GC_data_start#	define DYNAMIC_LOADING#     else	extern char etext[];#	define DATASTART ((ptr_t)(etext))#     endif#   endif# endif# ifdef I386#   define MACH_TYPE "I386"#   define ALIGNMENT 4	/* Appears to hold for all "32 bit" compilers	*/			/* except Borland.  The -a4 option fixes 	*/			/* Borland.					*/                        /* Ivan Demakov: For Watcom the option is -zp4. */#   ifndef SMALL_CONFIG#     define ALIGN_DOUBLE /* Not strictly necessary, but may give speed   */			  /* improvement on Pentiums.			  */#   endif#   ifdef HAVE_BUILTIN_UNWIND_INIT#	define USE_GENERIC_PUSH_REGS#   endif#   ifdef SEQUENT#	define OS_TYPE "SEQUENT"	extern int etext[];#       define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))#       define STACKBOTTOM ((ptr_t) 0x3ffff000) #   endif#   ifdef BEOS#     define OS_TYPE "BEOS"#     include <OS.h>#     define GETPAGESIZE() B_PAGE_SIZE      extern int etext[];#     define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))#   endif#   ifdef SUNOS5#	define OS_TYPE "SUNOS5"        extern int _etext[], _end[];  	extern char * GC_SysVGetDataStart();#       define DATASTART GC_SysVGetDataStart(0x1000, _etext)#	define DATAEND (_end)/*	# define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7,  	*//*      but reportedly breaks under 2.8.  It appears that the stack	*//* 	base is a property of the executable, so this should not break	*//* 	old executables.						*//*  	HEURISTIC2 probably works, but this appears to be preferable.	*/#       include <sys/vm.h>#	define STACKBOTTOM USRSTACK/* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. *//* It appears to be fixed in 2.8 and 2.9.				*/#	ifdef SOLARIS25_PROC_VDB_BUG_FIXED#	  define PROC_VDB#	endif#	define DYNAMIC_LOADING#	if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)#	    define USE_MMAP	    /* Otherwise we now use calloc.  Mmap may result in the	*/	    /* heap interleaved with thread stacks, which can result in	*/	    /* excessive blacklisting.  Sbrk is unusable since it	*/	    /* doesn't interact correctly with the system malloc.	*/#	endif#       ifdef USE_MMAP#         define HEAP_START (ptr_t)0x40000000#       else#	  define HEAP_START DATAEND#       endif#   endif#   ifdef SCO#	define OS_TYPE "SCO"	extern int etext[];#   	define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \				  & ~0x3fffff) \				 +((word)etext & 0xfff))#	define STACKBOTTOM ((ptr_t) 0x7ffffffc)#   endif#   ifdef SCO_ELF#       define OS_TYPE "SCO_ELF"        extern int etext[];#       define DATASTART ((ptr_t)(etext))#       define STACKBOTTOM ((ptr_t) 0x08048000)#       define DYNAMIC_LOADING#	define ELF_CLASS ELFCLASS32#   endif#   ifdef LINUX#	ifndef __GNUC__	  /* The Intel compiler doesn't like inline assembly */#	  define USE_GENERIC_PUSH_REGS# 	endif#	define OS_TYPE "LINUX"#       define LINUX_STACKBOTTOM#	if 0#	  define HEURISTIC1#         undef STACK_GRAN#         define STACK_GRAN 0x10000000	  /* STACKBOTTOM is usually 0xc0000000, but this changes with	*/	  /* different kernel configurations.  In particular, systems	*/	  /* with 2GB physical memory will usually move the user	*/	  /* address space limit, and hence initial SP to 0x80000000.	*/#       endif#       if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)#	    define MPROTECT_VDB#	else	    /* We seem to get random errors in incremental mode,	*/	    /* possibly because Linux threads is itself a malloc client */	    /* and can't deal with the signals.				*/#	endif#       ifdef __ELF__#            define DYNAMIC_LOADING#	     ifdef UNDEFINED	/* includes ro data */	       extern int _etext[];#              define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))#	     endif#	     include <features.h>#	     if defined(__GLIBC__) && __GLIBC__ >= 2#		 define LINUX_DATA_START#	     else     	         extern char **__environ;#                define DATASTART ((ptr_t)(&__environ))			      /* hideous kludge: __environ is the first */			      /* word in crt0.o, and delimits the start */			      /* of the data segment, no matter which   */			      /* ld options were passed through.        */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -