From 15072eb1299f2e6f415798e4bbaf054ddc905645 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Thu, 9 Sep 2004 17:11:18 +0000 Subject: [PATCH] defaults.h (MULTIPLE_SYMBOL_SPACES): Provide default. * defaults.h (MULTIPLE_SYMBOL_SPACES): Provide default. * config/arm/pecoff.h, config/i386/beos-elf.h * config/i386/cygming.h, config/i386/i386-interix.h: Define MULTIPLE_SYMBOL_SPACES to 1, not nothing. Remove comment cloned from manual. * doc/tm.texi: Update description of MULTIPLE_SYMBOL_SPACES. cp: * decl2.c (import_export_class) * lex.c (handle_pragma_interface): Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef. From-SVN: r87243 --- gcc/ChangeLog | 11 ++++++++++- gcc/config/arm/pe.h | 7 ++----- gcc/config/i386/beos-elf.h | 7 ++----- gcc/config/i386/cygming.h | 7 ++----- gcc/config/i386/i386-interix.h | 7 ++----- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/decl2.c | 8 ++++---- gcc/cp/lex.c | 6 +++--- gcc/defaults.h | 5 +++++ gcc/doc/tm.texi | 11 +++++++---- 10 files changed, 43 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76581c8f8be..bf58622e8fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-09-09 Zack Weinberg + + * defaults.h (MULTIPLE_SYMBOL_SPACES): Provide default. + * config/arm/pecoff.h, config/i386/beos-elf.h + * config/i386/cygming.h, config/i386/i386-interix.h: + Define MULTIPLE_SYMBOL_SPACES to 1, not nothing. Remove + comment cloned from manual. + * doc/tm.texi: Update description of MULTIPLE_SYMBOL_SPACES. + 2004-09-09 Frank Ch. Eigler * builtins.c (build_va_arg_indirect_ref): New function. @@ -393,7 +402,7 @@ (bdesc_int_void2arg, bdesc_prefetches): New arrays. (frv_init_builtins): Register the above builtins. (frv_int_to_acc): Use ACC_MASK to check for valid accumulator - registers. Turn the referenced accumulators into global registers. + registers. Turn the referenced accumulators into global registers. (frv_read_iacc_argument): New function. (frv_expand_int_void2arg, frv_expand_prefetches): New functions. (frv_split_iacc_move): New function. diff --git a/gcc/config/arm/pe.h b/gcc/config/arm/pe.h index 63c127c1a61..afaade2cb61 100644 --- a/gcc/config/arm/pe.h +++ b/gcc/config/arm/pe.h @@ -78,11 +78,8 @@ call_used_regs [11] = 1; -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* PE/COFF uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 #define TARGET_ASM_UNIQUE_SECTION arm_pe_unique_section #define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section diff --git a/gcc/config/i386/beos-elf.h b/gcc/config/i386/beos-elf.h index b0de9bba834..23b3a22921d 100644 --- a/gcc/config/i386/beos-elf.h +++ b/gcc/config/i386/beos-elf.h @@ -235,8 +235,5 @@ Boston, MA 02111-1307, USA. */ /* BeOS headers are C++-aware (and often use C++). */ #define NO_IMPLICIT_EXTERN_C -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* BeOS uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index d04ef6e0b7b..a54e8a9718b 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -258,11 +258,8 @@ do { \ #define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* Windows uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 extern void i386_pe_unique_section (TREE, int); #define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h index 971f7cc7e4b..5d2d72f27f8 100644 --- a/gcc/config/i386/i386-interix.h +++ b/gcc/config/i386/i386-interix.h @@ -337,11 +337,8 @@ while (0) .data$ sections correctly. See corresponding note in i386/interix.c. MK. */ -/* Define this macro if in some cases global symbols from one translation - unit may not be bound to undefined symbols in another translation unit - without user intervention. For instance, under Microsoft Windows - symbols must be explicitly imported from shared libraries (DLLs). */ -#define MULTIPLE_SYMBOL_SPACES +/* Interix uses explicit import from shared libraries. */ +#define MULTIPLE_SYMBOL_SPACES 1 extern void i386_pe_unique_section (tree, int); #define TARGET_ASM_UNIQUE_SECTION i386_pe_unique_section diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2792cca7fed..9bd87e1aad4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-09-09 Zack Weinberg + + * decl2.c (import_export_class) + * lex.c (handle_pragma_interface): + Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef. + 2004-09-08 Ziemowit Laski * Make-lang.in (cp/semantics.o): Depend on c-common.h. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 03c468dfd42..bb3e4e89def 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1438,7 +1438,7 @@ import_export_class (tree ctype) if (CLASSTYPE_INTERFACE_KNOWN (ctype)) return; - /* If MULTIPLE_SYMBOL_SPACES is defined and we saw a #pragma interface, + /* If MULTIPLE_SYMBOL_SPACES is set and we saw a #pragma interface, we will have CLASSTYPE_INTERFACE_ONLY set but not CLASSTYPE_INTERFACE_KNOWN. In that case, we don't want to use this heuristic because someone will supply a #pragma implementation @@ -1472,10 +1472,10 @@ import_export_class (tree ctype) import_export = (DECL_REALLY_EXTERN (method) ? -1 : 1); } -#ifdef MULTIPLE_SYMBOL_SPACES - if (import_export == -1) + /* When MULTIPLE_SYMBOL_SPACES is set, we cannot count on seeing + a definition anywhere else. */ + if (MULTIPLE_SYMBOL_SPACES && import_export == -1) import_export = 0; -#endif /* Allow backends the chance to overrule the decision. */ if (targetm.cxx.import_export_class) diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 468585edef5..2a48d995a0e 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -505,9 +505,9 @@ handle_pragma_interface (cpp_reader* dfile ATTRIBUTE_UNUSED ) } interface_only = interface_strcmp (main_filename); -#ifdef MULTIPLE_SYMBOL_SPACES - if (! interface_only) -#endif + /* If MULTIPLE_SYMBOL_SPACES is set, we cannot assume that we can see + a definition in another file. */ + if (!MULTIPLE_SYMBOL_SPACES || !interface_only) interface_unknown = 0; finfo->interface_only = interface_only; diff --git a/gcc/defaults.h b/gcc/defaults.h index 588d0fc9918..849e5a96b50 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -291,6 +291,11 @@ do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \ # define USE_COMMON_FOR_ONE_ONLY 1 #endif +/* By default we can assume that all global symbols are in one namespace, + across all shared libraries. */ +#ifndef MULTIPLE_SYMBOL_SPACES +# define MULTIPLE_SYMBOL_SPACES 0 +#endif /* If the target supports init_priority C++ attribute, give SUPPORTS_INIT_PRIORITY a nonzero value. */ diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 0734b2cebc5..df72053313d 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -9114,10 +9114,13 @@ You need not define this macro if it would always return zero. @end defmac @defmac MULTIPLE_SYMBOL_SPACES -Define this macro if in some cases global symbols from one translation -unit may not be bound to undefined symbols in another translation unit -without user intervention. For instance, under Microsoft Windows -symbols must be explicitly imported from shared libraries (DLLs). +Define this macro as a C expression that is nonzero if, in some cases, +global symbols from one translation unit may not be bound to undefined +symbols in another translation unit without user intervention. For +instance, under Microsoft Windows symbols must be explicitly imported +from shared libraries (DLLs). + +You need not define this macro if it would always evaluate to zero. @end defmac @deftypefn {Target Hook} tree TARGET_MD_ASM_CLOBBERS (tree @var{clobbers}) -- 2.30.2