Index: gcc/gcc/ChangeLog

2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* config/darwin.h (LINK_SPEC): Default weak_reference_mismatches
	to 'non-weak'.
	(MAKE_DECL_ONE_ONLY): Set DECL_WEAK.
	(ASM_MAKE_LABEL_LINKONCE): Delete.
	(ASM_WEAKEN_DECL): New.
	(ASM_DECLARE_OBJECT_NAME): Look at DECL_WEAK not DECL_ONE_ONLY.
	(ASM_DECLARE_FUNCTION_NAME): Likewise.
	(TEXT_SECTION_ASM_OP): Add a tab.
	(DATA_SECTION_ASM_OP): Likewise.
	(SECTION_FUNCTION): Add a tab.  Use fputs.  Don't call
	data_section on every section change.
	(EXTRA_SECTIONS): Add a bunch of new extra sections.
	(EXTRA_SECTION_FUNCTIONS): Likewise.
	(USE_SELECT_SECTION_FOR_FUNCTIONS): Define.
	(JCR_SECTION_NAME): Define.
	(TARGET_SECTION_TYPE_FLAGS): Don't define.
	* config/darwin.c (darwin_encode_section_info): A symbol is defined
	in this file if it is not weak.
	(textcoal_section): Delete.
	(datacoal_section): Delete.
	(darwin_make_decl_one_only): Delete.
	(machopic_select_section): Handle functions.
	(darwin_asm_named_section): Add a tab.
	(darwin_section_type_flags): Delete.
	(darwin_unique_section): Delete contents.
	(darwin_emit_unwind_label): Add a tab.  Make decls weak if
	DECL_WEAK is set.
	* config/darwin-protos.h (darwin_section_type_flags): Delete.
	(darwin_make_decl_one_only): Delete.
	(text_coal_section): New.
	(text_unlikely_section): New.
	(text_unlikely_coal_section): New.
	(const_coal_section): New.
	(data_coal_section): New.
	(const_data_coal_section): New.
	* varasm.c (function_section): Honour
	USE_SELECT_SECTION_FOR_FUNCTIONS.
	* dwarf2out.c (output_call_frame_info): Look at DECL_WEAK when
	TARGET_USES_WEAK_UNWIND_INFO is in effect.
	* dbxout.c (dbxout_source_file): Don't change sections while
	a function is being output.

Index: gcc/testsuite/ChangeLog
2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* objc.dg/image-info.m: Update for changes to section selection.

Index: libjava/ChangeLog
2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* Makefile.am (DARWIN_CRT_SRC): New.
	(libgcj_la_SOURCES): Use it.
	* configure.ac: Define USING_DARWIN_CRT when on Darwin.
	* darwin.cc: New file.
	* include/jvm.h (_Jv_RegisterClasses): Constify.
	(_Jv_RegisterClasses_Counted): New prototype.
	* java/lang/Class.h: Include stddef.h.
	(_Jv_RegisterClasses): Constify.
	(_Jv_RegisterClasses_Counted): New prototype.
	(Object): Make '_Jv_RegisterClasses_Counted' a friend.
	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Constify.
	(_Jv_RegisterClasses_Counted): New function.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

Index: libstdc++-v3/ChangeLog
2004-10-25  Geoffrey Keating  <geoffk@apple.com>

	* libsupc++/new_op.cc (new): Make weak.
	* libsupc++/new_opnt.cc (new): Make weak.
	* libsupc++/new_opv.cc (new): Make weak.
	* libsupc++/new_opvnt.cc (new): Make weak.
	* libsupc++/delete_op.cc (delete): Make weak.
	* libsupc++/delete_opnt.cc (delete): Make weak.
	* libsupc++/delete_opv.cc (delete): Make weak.
	* libsupc++/delete_opvnt.cc (delete): Make weak.

From-SVN: r89572
This commit is contained in:
Geoffrey Keating 2004-10-26 06:09:05 +00:00 committed by Geoffrey Keating
parent 595961fccb
commit f1a6626519
31 changed files with 528 additions and 257 deletions

View file

@ -1,3 +1,47 @@
2004-10-25 Geoffrey Keating <geoffk@apple.com>
* config/darwin.h (LINK_SPEC): Default weak_reference_mismatches
to 'non-weak'.
(MAKE_DECL_ONE_ONLY): Set DECL_WEAK.
(ASM_MAKE_LABEL_LINKONCE): Delete.
(ASM_WEAKEN_DECL): New.
(ASM_DECLARE_OBJECT_NAME): Look at DECL_WEAK not DECL_ONE_ONLY.
(ASM_DECLARE_FUNCTION_NAME): Likewise.
(TEXT_SECTION_ASM_OP): Add a tab.
(DATA_SECTION_ASM_OP): Likewise.
(SECTION_FUNCTION): Add a tab. Use fputs. Don't call
data_section on every section change.
(EXTRA_SECTIONS): Add a bunch of new extra sections.
(EXTRA_SECTION_FUNCTIONS): Likewise.
(USE_SELECT_SECTION_FOR_FUNCTIONS): Define.
(JCR_SECTION_NAME): Define.
(TARGET_SECTION_TYPE_FLAGS): Don't define.
* config/darwin.c (darwin_encode_section_info): A symbol is defined
in this file if it is not weak.
(textcoal_section): Delete.
(datacoal_section): Delete.
(darwin_make_decl_one_only): Delete.
(machopic_select_section): Handle functions.
(darwin_asm_named_section): Add a tab.
(darwin_section_type_flags): Delete.
(darwin_unique_section): Delete contents.
(darwin_emit_unwind_label): Add a tab. Make decls weak if
DECL_WEAK is set.
* config/darwin-protos.h (darwin_section_type_flags): Delete.
(darwin_make_decl_one_only): Delete.
(text_coal_section): New.
(text_unlikely_section): New.
(text_unlikely_coal_section): New.
(const_coal_section): New.
(data_coal_section): New.
(const_data_coal_section): New.
* varasm.c (function_section): Honour
USE_SELECT_SECTION_FOR_FUNCTIONS.
* dwarf2out.c (output_call_frame_info): Look at DECL_WEAK when
TARGET_USES_WEAK_UNWIND_INFO is in effect.
* dbxout.c (dbxout_source_file): Don't change sections while
a function is being output.
2004-10-25 David Ayers <d.ayers@inode.at> 2004-10-25 David Ayers <d.ayers@inode.at>
* c-common.h: Remove RID_ID. * c-common.h: Remove RID_ID.

View file

@ -70,7 +70,6 @@ extern void machopic_select_rtx_section (enum machine_mode, rtx,
extern void darwin_unique_section (tree decl, int reloc); extern void darwin_unique_section (tree decl, int reloc);
extern void darwin_asm_named_section (const char *, unsigned int, tree); extern void darwin_asm_named_section (const char *, unsigned int, tree);
extern unsigned int darwin_section_type_flags (tree, const char *, int);
extern void darwin_non_lazy_pcrel (FILE *, rtx); extern void darwin_non_lazy_pcrel (FILE *, rtx);
extern void darwin_emit_unwind_label (FILE *, tree, int, int); extern void darwin_emit_unwind_label (FILE *, tree, int, int);
@ -81,12 +80,17 @@ extern void darwin_pragma_unused (struct cpp_reader *);
extern void darwin_file_end (void); extern void darwin_file_end (void);
extern void darwin_make_decl_one_only (tree decl);
extern void darwin_mark_decl_preserved (const char *); extern void darwin_mark_decl_preserved (const char *);
/* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */ /* Expanded by EXTRA_SECTION_FUNCTIONS into varasm.o. */
extern void text_coal_section (void);
extern void text_unlikely_section (void);
extern void text_unlikely_coal_section (void);
extern void const_section (void); extern void const_section (void);
extern void const_coal_section (void);
extern void const_data_section (void); extern void const_data_section (void);
extern void const_data_coal_section (void);
extern void data_coal_section (void);
extern void cstring_section (void); extern void cstring_section (void);
extern void literal4_section (void); extern void literal4_section (void);
extern void literal8_section (void); extern void literal8_section (void);

View file

@ -976,7 +976,7 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_VARIABLE; SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_VARIABLE;
if (!DECL_EXTERNAL (decl) if (!DECL_EXTERNAL (decl)
&& (!TREE_PUBLIC (decl) || (!DECL_ONE_ONLY (decl) && !DECL_WEAK (decl))) && (!TREE_PUBLIC (decl) || !DECL_WEAK (decl))
&& ((TREE_STATIC (decl) && ((TREE_STATIC (decl)
&& (!DECL_COMMON (decl) || !TREE_PUBLIC (decl))) && (!DECL_COMMON (decl) || !TREE_PUBLIC (decl)))
|| (!DECL_COMMON (decl) && DECL_INITIAL (decl) || (!DECL_COMMON (decl) && DECL_INITIAL (decl)
@ -989,29 +989,6 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_STATIC; SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_STATIC;
} }
static GTY(()) tree textcoal_section = 0;
static GTY(()) tree datacoal_section = 0;
void
darwin_make_decl_one_only (tree decl)
{
tree sec = 0;
if (textcoal_section == 0)
{
static const char *ts = "__TEXT,__textcoal_nt,coalesced";
static const char *ds = "__DATA,__datacoal_nt,coalesced";
textcoal_section = build_string (strlen (ts), ts);
datacoal_section = build_string (strlen (ds), ds);
}
sec = TREE_CODE (decl) == FUNCTION_DECL
? textcoal_section
: datacoal_section;
TREE_PUBLIC (decl) = 1;
DECL_ONE_ONLY (decl) = 1;
DECL_SECTION_NAME (decl) = sec;
}
void void
darwin_mark_decl_preserved (const char *name) darwin_mark_decl_preserved (const char *name)
{ {
@ -1025,13 +1002,23 @@ machopic_select_section (tree exp, int reloc,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{ {
void (*base_function)(void); void (*base_function)(void);
bool weak_p = DECL_P (exp) && DECL_WEAK (exp);
static void (* const base_funs[][2])(void) = {
{ text_section, text_coal_section },
{ text_unlikely_section, text_unlikely_coal_section },
{ readonly_data_section, const_coal_section },
{ const_data_section, const_data_coal_section },
{ data_section, data_coal_section }
};
if (decl_readonly_section_1 (exp, reloc, MACHOPIC_INDIRECT)) if (TREE_CODE (exp) == FUNCTION_DECL)
base_function = readonly_data_section; base_function = base_funs[reloc][weak_p];
else if (decl_readonly_section_1 (exp, reloc, MACHOPIC_INDIRECT))
base_function = base_funs[2][weak_p];
else if (TREE_READONLY (exp) || TREE_CONSTANT (exp)) else if (TREE_READONLY (exp) || TREE_CONSTANT (exp))
base_function = const_data_section; base_function = base_funs[3][weak_p];
else else
base_function = data_section; base_function = base_funs[4][weak_p];
if (TREE_CODE (exp) == STRING_CST if (TREE_CODE (exp) == STRING_CST
&& ((size_t) TREE_STRING_LENGTH (exp) && ((size_t) TREE_STRING_LENGTH (exp)
@ -1125,6 +1112,28 @@ machopic_select_section (tree exp, int reloc,
else else
base_function (); base_function ();
} }
/* ::operator new and ::operator delete must be coalesced, even
if not weak. There are 8 variants that we look for. */
else if (TREE_CODE (exp) == FUNCTION_DECL
&& ! DECL_ONE_ONLY (exp))
{
const char * name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (exp));
if (name[0] == '_' && name[1] == 'Z'
&& ((name[2] == 'n' && (name[3] == 'a' || name[3] == 'w')
&& name[4] == 'm')
|| (name[2] == 'd' && (name[3] == 'a' || name[3] == 'l')
&& name[4] == 'P' && name[5] == 'v')))
{
bool delete_p = name[2] == 'd';
if (name[5 + delete_p] == 0
|| strcmp (name + 5 + delete_p, "KSt9nothrow_t") == 0)
base_funs[reloc][1] ();
else
base_function ();
}
else
base_function ();
}
else else
base_function (); base_function ();
} }
@ -1191,30 +1200,13 @@ darwin_asm_named_section (const char *name,
unsigned int flags ATTRIBUTE_UNUSED, unsigned int flags ATTRIBUTE_UNUSED,
tree decl ATTRIBUTE_UNUSED) tree decl ATTRIBUTE_UNUSED)
{ {
fprintf (asm_out_file, ".section %s\n", name); fprintf (asm_out_file, "\t.section %s\n", name);
} }
unsigned int
darwin_section_type_flags (tree decl, const char *name, int reloc)
{
unsigned int flags = default_section_type_flags (decl, name, reloc);
/* Weak or linkonce variables live in a writable section. */
if (decl != 0 && TREE_CODE (decl) != FUNCTION_DECL
&& (DECL_WEAK (decl) || DECL_ONE_ONLY (decl)))
flags |= SECTION_WRITE;
return flags;
}
void void
darwin_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED) darwin_unique_section (tree decl ATTRIBUTE_UNUSED, int reloc ATTRIBUTE_UNUSED)
{ {
/* Darwin does not use unique sections. However, the target's /* Darwin does not use unique sections. */
unique_section hook is called for linkonce symbols. We need
to set an appropriate section for such symbols. */
if (DECL_ONE_ONLY (decl) && !DECL_SECTION_NAME (decl))
darwin_make_decl_one_only (decl);
} }
#define HAVE_DEAD_STRIP 0 #define HAVE_DEAD_STRIP 0
@ -1265,14 +1257,14 @@ darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
strcat(lab, "\""); strcat(lab, "\"");
if (TREE_PUBLIC (decl)) if (TREE_PUBLIC (decl))
fprintf (file, "%s %s\n", fprintf (file, "\t%s %s\n",
(DECL_VISIBILITY (decl) != VISIBILITY_HIDDEN (DECL_VISIBILITY (decl) != VISIBILITY_HIDDEN
? ".globl" ? ".globl"
: ".private_extern"), : ".private_extern"),
lab); lab);
if (DECL_ONE_ONLY (decl) && TREE_PUBLIC (decl)) if (DECL_WEAK (decl))
fprintf (file, ".weak_definition %s\n", lab); fprintf (file, "\t.weak_definition %s\n", lab);
if (empty) if (empty)
{ {

View file

@ -295,6 +295,7 @@ extern const char *darwin_fix_and_continue_switch;
%{undefined*} \ %{undefined*} \
%{Zunexported_symbols_list*:-unexported_symbols_list %*} \ %{Zunexported_symbols_list*:-unexported_symbols_list %*} \
%{Zweak_reference_mismatches*:-weak_reference_mismatches %*} \ %{Zweak_reference_mismatches*:-weak_reference_mismatches %*} \
%{!Zweak_reference_mismatches*:-weak_reference_mismatches non-weak} \
%{X} \ %{X} \
%{y*} \ %{y*} \
%{w} \ %{w} \
@ -364,16 +365,33 @@ extern const char *darwin_fix_and_continue_switch;
#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END #define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
/* Making a symbols weak on Darwin requires more than just setting DECL_WEAK. */ /* GCC's definition of 'one_only' is the same as its definition of 'weak'. */
#define MAKE_DECL_ONE_ONLY(DECL) darwin_make_decl_one_only (DECL) #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
/* Representation of linkonce symbols for the MACH-O assembler. Linkonce /* Mach-O supports 'weak imports', and 'weak definitions' in coalesced
symbols must be given a special section *and* must be preceded by a sections. machopic_select_section ensures that weak variables go in
special assembler directive. */ coalesced sections. Weak aliases (or any other kind of aliases) are
#define ASM_MAKE_LABEL_LINKONCE(FILE, NAME) \ not supported. Weak symbols that aren't visible outside the .s file
do { const char* _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \ are not supported. */
fputs (".weak_definition ", FILE); assemble_name (FILE, _x); \ #define ASM_WEAKEN_DECL(FILE, DECL, NAME, ALIAS) \
fputs ("\n", FILE); }} while (0) do { \
if (ALIAS) \
{ \
warning ("alias definitions not supported in Mach-O; ignored"); \
break; \
} \
\
if (! DECL_EXTERNAL (DECL) && TREE_PUBLIC (DECL)) \
targetm.asm_out.globalize_label (FILE, NAME); \
if (DECL_EXTERNAL (DECL)) \
fputs ("\t.weak_reference ", FILE); \
else if (TREE_PUBLIC (DECL)) \
fputs ("\t.weak_definition ", FILE); \
else \
break; \
assemble_name (FILE, NAME); \
fputc ('\n', FILE); \
} while (0)
/* We support hidden visibility */ /* We support hidden visibility */
#undef TARGET_SUPPORTS_HIDDEN #undef TARGET_SUPPORTS_HIDDEN
@ -455,37 +473,37 @@ extern const char *darwin_fix_and_continue_switch;
const char *xname = NAME; \ const char *xname = NAME; \
if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \
xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \
if (! DECL_ONE_ONLY (DECL) && ! DECL_WEAK (DECL)) \ if (! DECL_WEAK (DECL) \
if ((TREE_STATIC (DECL) \ && ((TREE_STATIC (DECL) \
&& (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
|| DECL_INITIAL (DECL)) \ || DECL_INITIAL (DECL))) \
machopic_define_symbol (DECL_RTL (DECL)); \ machopic_define_symbol (DECL_RTL (DECL)); \
if ((TREE_STATIC (DECL) \ if ((TREE_STATIC (DECL) \
&& (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
|| DECL_INITIAL (DECL)) \ || DECL_INITIAL (DECL)) \
(* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \ (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \
ASM_OUTPUT_LABEL (FILE, xname); \ ASM_OUTPUT_LABEL (FILE, xname); \
/* Darwin doesn't support zero-size objects, so give them a \ /* Darwin doesn't support zero-size objects, so give them a \
byte. */ \ byte. */ \
if (tree_low_cst (DECL_SIZE_UNIT (DECL), 1) == 0) \ if (tree_low_cst (DECL_SIZE_UNIT (DECL), 1) == 0) \
assemble_zeros (1); \ assemble_zeros (1); \
} while (0) } while (0)
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do { \ do { \
const char *xname = NAME; \ const char *xname = NAME; \
if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \
xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \
if (! DECL_ONE_ONLY (DECL) && ! DECL_WEAK (DECL)) \ if (! DECL_WEAK (DECL) \
if ((TREE_STATIC (DECL) \ && ((TREE_STATIC (DECL) \
&& (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
|| DECL_INITIAL (DECL)) \ || DECL_INITIAL (DECL))) \
machopic_define_symbol (DECL_RTL (DECL)); \ machopic_define_symbol (DECL_RTL (DECL)); \
if ((TREE_STATIC (DECL) \ if ((TREE_STATIC (DECL) \
&& (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
|| DECL_INITIAL (DECL)) \ || DECL_INITIAL (DECL)) \
(* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \ (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false); \
ASM_OUTPUT_LABEL (FILE, xname); \ ASM_OUTPUT_LABEL (FILE, xname); \
} while (0) } while (0)
#define ASM_DECLARE_CONSTANT_NAME(FILE, NAME, EXP, SIZE) \ #define ASM_DECLARE_CONSTANT_NAME(FILE, NAME, EXP, SIZE) \
@ -529,12 +547,12 @@ extern const char *darwin_fix_and_continue_switch;
/* Output before executable code. */ /* Output before executable code. */
#undef TEXT_SECTION_ASM_OP #undef TEXT_SECTION_ASM_OP
#define TEXT_SECTION_ASM_OP ".text" #define TEXT_SECTION_ASM_OP "\t.text"
/* Output before writable data. */ /* Output before writable data. */
#undef DATA_SECTION_ASM_OP #undef DATA_SECTION_ASM_OP
#define DATA_SECTION_ASM_OP ".data" #define DATA_SECTION_ASM_OP "\t.data"
#undef ALIGN_ASM_OP #undef ALIGN_ASM_OP
#define ALIGN_ASM_OP ".align" #define ALIGN_ASM_OP ".align"
@ -580,9 +598,8 @@ FUNCTION (void) \
{ \ { \
if (OBJC) \ if (OBJC) \
objc_section_init (); \ objc_section_init (); \
data_section (); \
if (asm_out_file) \ if (asm_out_file) \
fprintf (asm_out_file, "%s\n", DIRECTIVE); \ fputs ("\t" DIRECTIVE "\n", asm_out_file); \
in_section = SECTION; \ in_section = SECTION; \
} \ } \
} \ } \
@ -590,150 +607,178 @@ FUNCTION (void) \
/* Darwin uses many types of special sections. */ /* Darwin uses many types of special sections. */
#undef EXTRA_SECTIONS #undef EXTRA_SECTIONS
#define EXTRA_SECTIONS \ #define EXTRA_SECTIONS \
in_text_coal, in_text_unlikely, in_text_unlikely_coal, \
in_const, in_const_data, in_cstring, in_literal4, in_literal8, \ in_const, in_const_data, in_cstring, in_literal4, in_literal8, \
in_const_coal, in_const_data_coal, in_data_coal, \
in_constructor, in_destructor, in_mod_init, in_mod_term, \ in_constructor, in_destructor, in_mod_init, in_mod_term, \
in_objc_class, in_objc_meta_class, in_objc_category, \ in_objc_class, in_objc_meta_class, in_objc_category, \
in_objc_class_vars, in_objc_instance_vars, \ in_objc_class_vars, in_objc_instance_vars, \
in_objc_cls_meth, in_objc_inst_meth, \ in_objc_cls_meth, in_objc_inst_meth, \
in_objc_cat_cls_meth, in_objc_cat_inst_meth, \ in_objc_cat_cls_meth, in_objc_cat_inst_meth, \
in_objc_selector_refs, \ in_objc_selector_refs, \
in_objc_selector_fixup, \ in_objc_selector_fixup, \
in_objc_symbols, in_objc_module_info, \ in_objc_symbols, in_objc_module_info, \
in_objc_protocol, in_objc_string_object, \ in_objc_protocol, in_objc_string_object, \
in_objc_constant_string_object, \ in_objc_constant_string_object, \
in_objc_image_info, \ in_objc_image_info, \
in_objc_class_names, in_objc_meth_var_names, \ in_objc_class_names, in_objc_meth_var_names, \
in_objc_meth_var_types, in_objc_cls_refs, \ in_objc_meth_var_types, in_objc_cls_refs, \
in_machopic_nl_symbol_ptr, \ in_machopic_nl_symbol_ptr, \
in_machopic_lazy_symbol_ptr, \ in_machopic_lazy_symbol_ptr, \
in_machopic_symbol_stub, \ in_machopic_symbol_stub, \
in_machopic_symbol_stub1, \ in_machopic_symbol_stub1, \
in_machopic_picsymbol_stub, \ in_machopic_picsymbol_stub, \
in_machopic_picsymbol_stub1, \ in_machopic_picsymbol_stub1, \
in_darwin_exception, in_darwin_eh_frame, \ in_darwin_exception, in_darwin_eh_frame, \
num_sections num_sections
#undef EXTRA_SECTION_FUNCTIONS #undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \ #define EXTRA_SECTION_FUNCTIONS \
static void objc_section_init (void); \ static void objc_section_init (void); \
SECTION_FUNCTION (const_section, \ SECTION_FUNCTION (text_coal_section, \
in_const, \ in_text_coal, \
".const", 0) \ ".section __TEXT,__textcoal_nt,coalesced," \
SECTION_FUNCTION (const_data_section, \ "pure_instructions", 0) \
in_const_data, \ SECTION_FUNCTION (text_unlikely_section, \
".const_data", 0) \ in_text_unlikely, \
SECTION_FUNCTION (cstring_section, \ ".section __TEXT,__text_unlikely,coalesced," \
in_cstring, \ "pure_instructions", 0) \
".cstring", 0) \ SECTION_FUNCTION (text_unlikely_coal_section, \
SECTION_FUNCTION (literal4_section, \ in_text_unlikely_coal, \
in_literal4, \ ".section __TEXT,__text_unlikely_coal," \
".literal4", 0) \ "coalesced,pure_instructions", 0) \
SECTION_FUNCTION (literal8_section, \ SECTION_FUNCTION (const_section, \
in_literal8, \ in_const, \
".literal8", 0) \ ".const", 0) \
SECTION_FUNCTION (constructor_section, \ SECTION_FUNCTION (const_coal_section, \
in_constructor, \ in_const_coal, \
".constructor", 0) \ ".section __TEXT,__const_coal,coalesced", 0) \
SECTION_FUNCTION (mod_init_section, \ SECTION_FUNCTION (const_data_section, \
in_mod_init, \ in_const_data, \
".mod_init_func", 0) \ ".const_data", 0) \
SECTION_FUNCTION (mod_term_section, \ SECTION_FUNCTION (const_data_coal_section, \
in_mod_term, \ in_const_data_coal, \
".mod_term_func", 0) \ ".section __DATA,__const_coal,coalesced", 0) \
SECTION_FUNCTION (destructor_section, \ SECTION_FUNCTION (data_coal_section, \
in_destructor, \ in_data_coal, \
".destructor", 0) \ ".section __DATA,__datacoal_nt,coalesced", 0) \
SECTION_FUNCTION (objc_class_section, \ SECTION_FUNCTION (cstring_section, \
in_objc_class, \ in_cstring, \
".objc_class", 1) \ ".cstring", 0) \
SECTION_FUNCTION (objc_meta_class_section, \ SECTION_FUNCTION (literal4_section, \
in_objc_meta_class, \ in_literal4, \
".objc_meta_class", 1) \ ".literal4", 0) \
SECTION_FUNCTION (objc_category_section, \ SECTION_FUNCTION (literal8_section, \
in_objc_category, \ in_literal8, \
".objc_category", 1) \ ".literal8", 0) \
SECTION_FUNCTION (objc_class_vars_section, \ SECTION_FUNCTION (constructor_section, \
in_objc_class_vars, \ in_constructor, \
".objc_class_vars", 1) \ ".constructor", 0) \
SECTION_FUNCTION (objc_instance_vars_section, \ SECTION_FUNCTION (mod_init_section, \
in_objc_instance_vars, \ in_mod_init, \
".objc_instance_vars", 1) \ ".mod_init_func", 0) \
SECTION_FUNCTION (objc_cls_meth_section, \ SECTION_FUNCTION (mod_term_section, \
in_objc_cls_meth, \ in_mod_term, \
".objc_cls_meth", 1) \ ".mod_term_func", 0) \
SECTION_FUNCTION (objc_inst_meth_section, \ SECTION_FUNCTION (destructor_section, \
in_objc_inst_meth, \ in_destructor, \
".objc_inst_meth", 1) \ ".destructor", 0) \
SECTION_FUNCTION (objc_cat_cls_meth_section, \ SECTION_FUNCTION (objc_class_section, \
in_objc_cat_cls_meth, \ in_objc_class, \
".objc_cat_cls_meth", 1) \ ".objc_class", 1) \
SECTION_FUNCTION (objc_cat_inst_meth_section, \ SECTION_FUNCTION (objc_meta_class_section, \
in_objc_cat_inst_meth, \ in_objc_meta_class, \
".objc_cat_inst_meth", 1) \ ".objc_meta_class", 1) \
SECTION_FUNCTION (objc_selector_refs_section, \ SECTION_FUNCTION (objc_category_section, \
in_objc_selector_refs, \ in_objc_category, \
".objc_message_refs", 1) \ ".objc_category", 1) \
SECTION_FUNCTION (objc_selector_fixup_section, \ SECTION_FUNCTION (objc_class_vars_section, \
in_objc_selector_fixup, \ in_objc_class_vars, \
".section __OBJC, __sel_fixup, regular, no_dead_strip", 1) \ ".objc_class_vars", 1) \
SECTION_FUNCTION (objc_symbols_section, \ SECTION_FUNCTION (objc_instance_vars_section, \
in_objc_symbols, \ in_objc_instance_vars, \
".objc_symbols", 1) \ ".objc_instance_vars", 1) \
SECTION_FUNCTION (objc_module_info_section, \ SECTION_FUNCTION (objc_cls_meth_section, \
in_objc_module_info, \ in_objc_cls_meth, \
".objc_module_info", 1) \ ".objc_cls_meth", 1) \
SECTION_FUNCTION (objc_protocol_section, \ SECTION_FUNCTION (objc_inst_meth_section, \
in_objc_protocol, \ in_objc_inst_meth, \
".objc_protocol", 1) \ ".objc_inst_meth", 1) \
SECTION_FUNCTION (objc_string_object_section, \ SECTION_FUNCTION (objc_cat_cls_meth_section, \
in_objc_string_object, \ in_objc_cat_cls_meth, \
".objc_string_object", 1) \ ".objc_cat_cls_meth", 1) \
SECTION_FUNCTION (objc_constant_string_object_section, \ SECTION_FUNCTION (objc_cat_inst_meth_section, \
in_objc_constant_string_object, \ in_objc_cat_inst_meth, \
".section __OBJC, __cstring_object, regular, no_dead_strip", 1) \ ".objc_cat_inst_meth", 1) \
/* Fix-and-Continue image marker. */ \ SECTION_FUNCTION (objc_selector_refs_section, \
SECTION_FUNCTION (objc_image_info_section, \ in_objc_selector_refs, \
in_objc_image_info, \ ".objc_message_refs", 1) \
".section __OBJC, __image_info, regular, no_dead_strip", 1) \ SECTION_FUNCTION (objc_selector_fixup_section, \
SECTION_FUNCTION (objc_class_names_section, \ in_objc_selector_fixup, \
in_objc_class_names, \ ".section __OBJC, __sel_fixup, regular, no_dead_strip", 1) \
".objc_class_names", 1) \ SECTION_FUNCTION (objc_symbols_section, \
SECTION_FUNCTION (objc_meth_var_names_section, \ in_objc_symbols, \
in_objc_meth_var_names, \ ".objc_symbols", 1) \
".objc_meth_var_names", 1) \ SECTION_FUNCTION (objc_module_info_section, \
SECTION_FUNCTION (objc_meth_var_types_section, \ in_objc_module_info, \
in_objc_meth_var_types, \ ".objc_module_info", 1) \
".objc_meth_var_types", 1) \ SECTION_FUNCTION (objc_protocol_section, \
SECTION_FUNCTION (objc_cls_refs_section, \ in_objc_protocol, \
in_objc_cls_refs, \ ".objc_protocol", 1) \
".objc_cls_refs", 1) \ SECTION_FUNCTION (objc_string_object_section, \
\ in_objc_string_object, \
SECTION_FUNCTION (machopic_lazy_symbol_ptr_section, \ ".objc_string_object", 1) \
in_machopic_lazy_symbol_ptr, \ SECTION_FUNCTION (objc_constant_string_object_section, \
".lazy_symbol_pointer", 0) \ in_objc_constant_string_object, \
SECTION_FUNCTION (machopic_nl_symbol_ptr_section, \ ".section __OBJC, __cstring_object, regular, " \
in_machopic_nl_symbol_ptr, \ "no_dead_strip", 1) \
".non_lazy_symbol_pointer", 0) \ /* Fix-and-Continue image marker. */ \
SECTION_FUNCTION (machopic_symbol_stub_section, \ SECTION_FUNCTION (objc_image_info_section, \
in_machopic_symbol_stub, \ in_objc_image_info, \
".symbol_stub", 0) \ ".section __OBJC, __image_info, regular, " \
SECTION_FUNCTION (machopic_symbol_stub1_section, \ "no_dead_strip", 1) \
in_machopic_symbol_stub1, \ SECTION_FUNCTION (objc_class_names_section, \
".section __TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16", 0)\ in_objc_class_names, \
SECTION_FUNCTION (machopic_picsymbol_stub_section, \ ".objc_class_names", 1) \
in_machopic_picsymbol_stub, \ SECTION_FUNCTION (objc_meth_var_names_section, \
".picsymbol_stub", 0) \ in_objc_meth_var_names, \
SECTION_FUNCTION (machopic_picsymbol_stub1_section, \ ".objc_meth_var_names", 1) \
in_machopic_picsymbol_stub1, \ SECTION_FUNCTION (objc_meth_var_types_section, \
".section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32", 0)\ in_objc_meth_var_types, \
SECTION_FUNCTION (darwin_exception_section, \ ".objc_meth_var_types", 1) \
in_darwin_exception, \ SECTION_FUNCTION (objc_cls_refs_section, \
".section __DATA,__gcc_except_tab", 0) \ in_objc_cls_refs, \
SECTION_FUNCTION (darwin_eh_frame_section, \ ".objc_cls_refs", 1) \
in_darwin_eh_frame, \ \
".section " EH_FRAME_SECTION_NAME ",__eh_frame" EH_FRAME_SECTION_ATTR, 0) \ SECTION_FUNCTION (machopic_lazy_symbol_ptr_section, \
\ in_machopic_lazy_symbol_ptr, \
".lazy_symbol_pointer", 0) \
SECTION_FUNCTION (machopic_nl_symbol_ptr_section, \
in_machopic_nl_symbol_ptr, \
".non_lazy_symbol_pointer", 0) \
SECTION_FUNCTION (machopic_symbol_stub_section, \
in_machopic_symbol_stub, \
".symbol_stub", 0) \
SECTION_FUNCTION (machopic_symbol_stub1_section, \
in_machopic_symbol_stub1, \
".section __TEXT,__symbol_stub1,symbol_stubs," \
"pure_instructions,16", 0) \
SECTION_FUNCTION (machopic_picsymbol_stub_section, \
in_machopic_picsymbol_stub, \
".picsymbol_stub", 0) \
SECTION_FUNCTION (machopic_picsymbol_stub1_section, \
in_machopic_picsymbol_stub1, \
".section __TEXT,__picsymbolstub1,symbol_stubs," \
"pure_instructions,32", 0) \
SECTION_FUNCTION (darwin_exception_section, \
in_darwin_exception, \
".section __DATA,__gcc_except_tab", 0) \
SECTION_FUNCTION (darwin_eh_frame_section, \
in_darwin_eh_frame, \
".section " EH_FRAME_SECTION_NAME ",__eh_frame" \
EH_FRAME_SECTION_ATTR, 0) \
\
static void \ static void \
objc_section_init (void) \ objc_section_init (void) \
{ \ { \
@ -771,6 +816,8 @@ objc_section_init (void) \
#undef TARGET_ASM_SELECT_SECTION #undef TARGET_ASM_SELECT_SECTION
#define TARGET_ASM_SELECT_SECTION machopic_select_section #define TARGET_ASM_SELECT_SECTION machopic_select_section
#define USE_SELECT_SECTION_FOR_FUNCTIONS
#undef TARGET_ASM_SELECT_RTX_SECTION #undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
#undef TARGET_ASM_UNIQUE_SECTION #undef TARGET_ASM_UNIQUE_SECTION
@ -918,6 +965,9 @@ enum machopic_addr_class {
#define EH_FRAME_SECTION_NAME "__TEXT" #define EH_FRAME_SECTION_NAME "__TEXT"
#define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support" #define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support"
/* Java runtime class list. */
#define JCR_SECTION_NAME "__DATA,jcr,regular,no_dead_strip"
#undef ASM_PREFERRED_EH_DATA_FORMAT #undef ASM_PREFERRED_EH_DATA_FORMAT
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(((CODE) == 2 && (GLOBAL) == 1) \ (((CODE) == 2 && (GLOBAL) == 1) \
@ -938,8 +988,6 @@ enum machopic_addr_class {
#undef TARGET_ASM_NAMED_SECTION #undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION darwin_asm_named_section #define TARGET_ASM_NAMED_SECTION darwin_asm_named_section
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS darwin_section_type_flags
#define DARWIN_REGISTER_TARGET_PRAGMAS() \ #define DARWIN_REGISTER_TARGET_PRAGMAS() \
do { \ do { \

View file

@ -759,14 +759,10 @@ dbxout_source_file (FILE *file, const char *filename)
fprintf (asm_out_file, ",%d,0,0,", N_SOL); fprintf (asm_out_file, ",%d,0,0,", N_SOL);
assemble_name (asm_out_file, ltext_label_name); assemble_name (asm_out_file, ltext_label_name);
fputc ('\n', asm_out_file); fputc ('\n', asm_out_file);
if (current_function_decl != NULL_TREE if (current_function_decl != NULL_TREE)
&& DECL_SECTION_NAME (current_function_decl) != NULL_TREE)
; /* Don't change section amid function. */ ; /* Don't change section amid function. */
else else
{ text_section ();
if (!in_text_section () && !in_unlikely_text_section ())
text_section ();
}
targetm.asm_out.internal_label (file, "Ltext", source_label_number); targetm.asm_out.internal_label (file, "Ltext", source_label_number);
source_label_number++; source_label_number++;
lastfile = filename; lastfile = filename;

View file

@ -2050,7 +2050,7 @@ output_call_frame_info (int for_eh)
/* If we make FDEs linkonce, we may have to emit an empty label for /* If we make FDEs linkonce, we may have to emit an empty label for
an FDE that wouldn't otherwise be emitted. We want to avoid an FDE that wouldn't otherwise be emitted. We want to avoid
having an FDE kept around when the function it refers to is having an FDE kept around when the function it refers to is
discarded. (Example where this matters: a primary function discarded. Example where this matters: a primary function
template in C++ requires EH information, but an explicit template in C++ requires EH information, but an explicit
specialization doesn't. */ specialization doesn't. */
if (TARGET_USES_WEAK_UNWIND_INFO if (TARGET_USES_WEAK_UNWIND_INFO
@ -2059,7 +2059,7 @@ output_call_frame_info (int for_eh)
for (i = 0; i < fde_table_in_use; i++) for (i = 0; i < fde_table_in_use; i++)
if ((fde_table[i].nothrow || fde_table[i].all_throwers_are_sibcalls) if ((fde_table[i].nothrow || fde_table[i].all_throwers_are_sibcalls)
&& !fde_table[i].uses_eh_lsda && !fde_table[i].uses_eh_lsda
&& ! DECL_ONE_ONLY (fde_table[i].decl)) && ! DECL_WEAK (fde_table[i].decl))
targetm.asm_out.unwind_label (asm_out_file, fde_table[i].decl, targetm.asm_out.unwind_label (asm_out_file, fde_table[i].decl,
for_eh, /* empty */ 1); for_eh, /* empty */ 1);
@ -2074,8 +2074,7 @@ output_call_frame_info (int for_eh)
for (i = 0; i < fde_table_in_use; i++) for (i = 0; i < fde_table_in_use; i++)
if (fde_table[i].uses_eh_lsda) if (fde_table[i].uses_eh_lsda)
any_eh_needed = any_lsda_needed = true; any_eh_needed = any_lsda_needed = true;
else if (TARGET_USES_WEAK_UNWIND_INFO else if (TARGET_USES_WEAK_UNWIND_INFO && DECL_WEAK (fde_table[i].decl))
&& DECL_ONE_ONLY (fde_table[i].decl))
any_eh_needed = true; any_eh_needed = true;
else if (! fde_table[i].nothrow else if (! fde_table[i].nothrow
&& ! fde_table[i].all_throwers_are_sibcalls) && ! fde_table[i].all_throwers_are_sibcalls)
@ -2222,7 +2221,7 @@ output_call_frame_info (int for_eh)
/* Don't emit EH unwind info for leaf functions that don't need it. */ /* Don't emit EH unwind info for leaf functions that don't need it. */
if (for_eh && !flag_asynchronous_unwind_tables && flag_exceptions if (for_eh && !flag_asynchronous_unwind_tables && flag_exceptions
&& (fde->nothrow || fde->all_throwers_are_sibcalls) && (fde->nothrow || fde->all_throwers_are_sibcalls)
&& (! TARGET_USES_WEAK_UNWIND_INFO || ! DECL_ONE_ONLY (fde->decl)) && ! (TARGET_USES_WEAK_UNWIND_INFO && DECL_WEAK (fde_table[i].decl))
&& !fde->uses_eh_lsda) && !fde->uses_eh_lsda)
continue; continue;

View file

@ -1,3 +1,7 @@
2004-10-25 Geoffrey Keating <geoffk@apple.com>
* objc.dg/image-info.m: Update for changes to section selection.
2004-10-25 David Ayers <d.ayers@inode.at> 2004-10-25 David Ayers <d.ayers@inode.at>
Ziemowit Laski <zlaski@apple.com> Ziemowit Laski <zlaski@apple.com>

View file

@ -35,4 +35,4 @@ extern void abort(void);
} }
@end @end
/* { dg-final { scan-assembler "\n.data\n.section __OBJC, __image_info.*\n\t.align.*\nL_OBJC_IMAGE_INFO.*:\n\t.long\t0\n\t.long\t1\n.data\n.objc_module_info\n" } } */ /* { dg-final { scan-assembler "\t.section __OBJC, __image_info.*\n\t.align.*\nL_OBJC_IMAGE_INFO.*:\n\t.long\t0\n\t.long\t1\n\t.objc_module_info\n" } } */

View file

@ -574,13 +574,19 @@ asm_output_aligned_bss (FILE *file, tree decl ATTRIBUTE_UNUSED,
void void
function_section (tree decl) function_section (tree decl)
{ {
#ifdef USE_SELECT_SECTION_FOR_FUNCTIONS
bool unlikely = scan_ahead_for_unlikely_executed_note (get_insns());
targetm.asm_out.select_section (decl, unlikely, DECL_ALIGN (decl));
#else
if (scan_ahead_for_unlikely_executed_note (get_insns())) if (scan_ahead_for_unlikely_executed_note (get_insns()))
unlikely_text_section (); unlikely_text_section ();
else if (decl != NULL_TREE else if (decl != NULL_TREE
&& DECL_SECTION_NAME (decl) != NULL_TREE) && DECL_SECTION_NAME (decl) != NULL_TREE)
named_section (decl, (char *) 0, 0); named_section (decl, (char *) 0, 0);
else else
text_section (); text_section ();
#endif
} }
/* Switch to read-only data section associated with function DECL. */ /* Switch to read-only data section associated with function DECL. */

View file

@ -1,3 +1,23 @@
2004-10-25 Geoffrey Keating <geoffk@apple.com>
* Makefile.am (DARWIN_CRT_SRC): New.
(libgcj_la_SOURCES): Use it.
* configure.ac: Define USING_DARWIN_CRT when on Darwin.
* darwin.cc: New file.
* include/jvm.h (_Jv_RegisterClasses): Constify.
(_Jv_RegisterClasses_Counted): New prototype.
* java/lang/Class.h: Include stddef.h.
(_Jv_RegisterClasses): Constify.
(_Jv_RegisterClasses_Counted): New prototype.
(Object): Make '_Jv_RegisterClasses_Counted' a friend.
* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Constify.
(_Jv_RegisterClasses_Counted): New function.
* configure: Regenerate.
* Makefile.in: Regenerate.
* gcj/Makefile.in: Regenerate.
* include/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
2004-10-25 Tom Tromey <tromey@redhat.com> 2004-10-25 Tom Tromey <tromey@redhat.com>
* java/util/ResourceBundle.java (tryBundle): Use * java/util/ResourceBundle.java (tryBundle): Use

View file

@ -69,6 +69,13 @@ else
SUBDIRS = $(DIRLTDL) gcj include SUBDIRS = $(DIRLTDL) gcj include
endif endif
## Darwin uses the jcr section, but doesn't use crtstuff.
if USING_DARWIN_CRT
DARWIN_CRT_SRC = darwin.cc
else
DARWIN_CRT_SRC =
endif
# write_entries_to_file - writes each entry in a list # write_entries_to_file - writes each entry in a list
# to the specified file. Each entry is written individually # to the specified file. Each entry is written individually
# to accomodate systems with severe command-line-length # to accomodate systems with severe command-line-length
@ -206,6 +213,7 @@ libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
$(BOEHMGC_SRC) $(NOGC_SRC) \ $(BOEHMGC_SRC) $(NOGC_SRC) \
$(BACKTRACE_SRC) \ $(BACKTRACE_SRC) \
$(POSIX_PLATFORM_SRC) $(WIN32_PLATFORM_SRC) $(ECOS_PLATFORM_SRC) \ $(POSIX_PLATFORM_SRC) $(WIN32_PLATFORM_SRC) $(ECOS_PLATFORM_SRC) \
$(DARWIN_CRT_SRC) \
$(POSIX_THREAD_SRC) $(WIN32_THREAD_SRC) $(NO_THREAD_SRC) $(POSIX_THREAD_SRC) $(WIN32_THREAD_SRC) $(NO_THREAD_SRC)
libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \ libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \ java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \

View file

@ -2261,8 +2261,8 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc resolve.cc \
javax/transaction/UserTransaction.java \ javax/transaction/UserTransaction.java \
java/lang/ConcreteProcess.java \ java/lang/ConcreteProcess.java \
gnu/classpath/Configuration.java boehm.cc nogc.cc \ gnu/classpath/Configuration.java boehm.cc nogc.cc \
sysdep/dwarf2-backtrace.cc posix.cc win32.cc posix-threads.cc \ sysdep/dwarf2-backtrace.cc posix.cc win32.cc darwin.cc \
win32-threads.cc no-threads.cc posix-threads.cc win32-threads.cc no-threads.cc
am__objects_6 = gnu/gcj/natCore.lo \ am__objects_6 = gnu/gcj/natCore.lo \
gnu/gcj/convert/JIS0208_to_Unicode.lo \ gnu/gcj/convert/JIS0208_to_Unicode.lo \
gnu/gcj/convert/JIS0212_to_Unicode.lo \ gnu/gcj/convert/JIS0212_to_Unicode.lo \
@ -4028,15 +4028,17 @@ am__objects_16 = java/lang/ConcreteProcess.lo \
@USING_POSIX_PLATFORM_TRUE@am__objects_20 = posix.lo @USING_POSIX_PLATFORM_TRUE@am__objects_20 = posix.lo
@USING_WIN32_PLATFORM_TRUE@am__objects_21 = win32.lo @USING_WIN32_PLATFORM_TRUE@am__objects_21 = win32.lo
@USING_ECOS_PLATFORM_TRUE@am__objects_22 = posix.lo @USING_ECOS_PLATFORM_TRUE@am__objects_22 = posix.lo
@USING_POSIX_THREADS_TRUE@am__objects_23 = posix-threads.lo @USING_DARWIN_CRT_TRUE@am__objects_23 = darwin.lo
@USING_WIN32_THREADS_TRUE@am__objects_24 = win32-threads.lo @USING_POSIX_THREADS_TRUE@am__objects_24 = posix-threads.lo
@USING_NO_THREADS_TRUE@am__objects_25 = no-threads.lo @USING_WIN32_THREADS_TRUE@am__objects_25 = win32-threads.lo
@USING_NO_THREADS_TRUE@am__objects_26 = no-threads.lo
am_libgcj_la_OBJECTS = prims.lo jni.lo exception.lo resolve.lo \ am_libgcj_la_OBJECTS = prims.lo jni.lo exception.lo resolve.lo \
defineclass.lo interpret.lo verify.lo $(am__objects_6) \ defineclass.lo interpret.lo verify.lo $(am__objects_6) \
$(am__objects_7) $(am__objects_15) $(am__objects_16) \ $(am__objects_7) $(am__objects_15) $(am__objects_16) \
$(am__objects_17) $(am__objects_18) $(am__objects_19) \ $(am__objects_17) $(am__objects_18) $(am__objects_19) \
$(am__objects_20) $(am__objects_21) $(am__objects_22) \ $(am__objects_20) $(am__objects_21) $(am__objects_22) \
$(am__objects_23) $(am__objects_24) $(am__objects_25) $(am__objects_23) $(am__objects_24) $(am__objects_25) \
$(am__objects_26)
libgcj_la_OBJECTS = $(am_libgcj_la_OBJECTS) libgcj_la_OBJECTS = $(am_libgcj_la_OBJECTS)
am_libgij_la_OBJECTS = gij.lo am_libgij_la_OBJECTS = gij.lo
libgij_la_OBJECTS = $(am_libgij_la_OBJECTS) libgij_la_OBJECTS = $(am_libgij_la_OBJECTS)
@ -4243,6 +4245,8 @@ THREADSPEC = @THREADSPEC@
TOOLKIT = @TOOLKIT@ TOOLKIT = @TOOLKIT@
USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@ USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@
USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@ USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@
USING_DARWIN_CRT_FALSE = @USING_DARWIN_CRT_FALSE@
USING_DARWIN_CRT_TRUE = @USING_DARWIN_CRT_TRUE@
USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@ USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@
USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@ USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@
USING_GCC_FALSE = @USING_GCC_FALSE@ USING_GCC_FALSE = @USING_GCC_FALSE@
@ -4355,6 +4359,8 @@ ACLOCAL_AMFLAGS = -I . -I ../config
@USING_NO_THREADS_TRUE@NO_THREAD_SRC = no-threads.cc @USING_NO_THREADS_TRUE@NO_THREAD_SRC = no-threads.cc
@TESTSUBDIR_FALSE@SUBDIRS = $(DIRLTDL) gcj include @TESTSUBDIR_FALSE@SUBDIRS = $(DIRLTDL) gcj include
@TESTSUBDIR_TRUE@SUBDIRS = $(DIRLTDL) testsuite gcj include @TESTSUBDIR_TRUE@SUBDIRS = $(DIRLTDL) testsuite gcj include
@USING_DARWIN_CRT_FALSE@DARWIN_CRT_SRC =
@USING_DARWIN_CRT_TRUE@DARWIN_CRT_SRC = darwin.cc
# write_entries_to_file - writes each entry in a list # write_entries_to_file - writes each entry in a list
# to the specified file. Each entry is written individually # to the specified file. Each entry is written individually
@ -4426,6 +4432,7 @@ libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
$(BOEHMGC_SRC) $(NOGC_SRC) \ $(BOEHMGC_SRC) $(NOGC_SRC) \
$(BACKTRACE_SRC) \ $(BACKTRACE_SRC) \
$(POSIX_PLATFORM_SRC) $(WIN32_PLATFORM_SRC) $(ECOS_PLATFORM_SRC) \ $(POSIX_PLATFORM_SRC) $(WIN32_PLATFORM_SRC) $(ECOS_PLATFORM_SRC) \
$(DARWIN_CRT_SRC) \
$(POSIX_THREAD_SRC) $(WIN32_THREAD_SRC) $(NO_THREAD_SRC) $(POSIX_THREAD_SRC) $(WIN32_THREAD_SRC) $(NO_THREAD_SRC)
libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \ libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
@ -18976,6 +18983,7 @@ distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boehm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boehm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwin.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defineclass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defineclass.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gij.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gij.Plo@am__quote@

26
libjava/configure vendored
View file

@ -310,7 +310,7 @@ ac_includes_default="\
# include <unistd.h> # include <unistd.h>
#endif" #endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcj_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs COMPPATH TESTSUBDIR_TRUE TESTSUBDIR_FALSE ONESTEP_TRUE ONESTEP_FALSE LIBGCJDEBUG INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_ECOS_PLATFORM_TRUE USING_ECOS_PLATFORM_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE tool_include_dir gcc_version LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS SUPPLY_BACKTRACE_TRUE SUPPLY_BACKTRACE_FALSE GCJH ZIP ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir GCJVERSION ALLOCA PERL BACKTRACESPEC SYSDEP_SOURCES here LIBOBJS LTLIBOBJS' ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcj_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S mkinstalldirs CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LDFLAGS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBGCJ_CFLAGS LIBGCJ_CXXFLAGS LIBGCJ_JAVAFLAGS INCLTDL LIBLTDL DIRLTDL LIBTOOL CXXCPP CPPFLAGS GCJ GCJFLAGS GCJDEPMODE am__fastdepGCJ_TRUE am__fastdepGCJ_FALSE subdirs COMPPATH TESTSUBDIR_TRUE TESTSUBDIR_FALSE ONESTEP_TRUE ONESTEP_FALSE LIBGCJDEBUG INTERPRETER LIBFFI LIBFFIINCS PLATFORM_INNER_NAT_HDRS CPP EGREP USING_WIN32_PLATFORM_TRUE USING_WIN32_PLATFORM_FALSE USING_POSIX_PLATFORM_TRUE USING_POSIX_PLATFORM_FALSE USING_ECOS_PLATFORM_TRUE USING_ECOS_PLATFORM_FALSE USING_DARWIN_CRT_TRUE USING_DARWIN_CRT_FALSE SYSTEMSPEC LIBGCJTESTSPEC ZLIBSPEC ZLIBTESTSPEC X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS TOOLKIT XLIB_AWT_TRUE XLIB_AWT_FALSE GTK_AWT_TRUE GTK_AWT_FALSE GTK_CAIRO_TRUE GTK_CAIRO_FALSE PKG_CONFIG CAIRO_CFLAGS CAIRO_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS GCLIBS GCINCS GCDEPS GCSPEC JC1GCSPEC GCTESTSPEC USING_BOEHMGC_TRUE USING_BOEHMGC_FALSE USING_NOGC_TRUE USING_NOGC_FALSE THREADLIBS THREADINCS THREADDEPS THREADSPEC THREADLDFLAGS THREADCXXFLAGS USING_POSIX_THREADS_TRUE USING_POSIX_THREADS_FALSE USING_WIN32_THREADS_TRUE USING_WIN32_THREADS_FALSE USING_NO_THREADS_TRUE USING_NO_THREADS_FALSE HASH_SYNC_SPEC USING_GCC_TRUE USING_GCC_FALSE tool_include_dir gcc_version LIBICONV LTLIBICONV GTK_CFLAGS GTK_LIBS GLIB_CFLAGS GLIB_LIBS LIBART_CFLAGS LIBART_LIBS SUPPLY_BACKTRACE_TRUE SUPPLY_BACKTRACE_FALSE GCJH ZIP ac_ct_GCJ ZLIBS SYS_ZLIBS ZINCS DIVIDESPEC CHECKREFSPEC EXCEPTIONSPEC IEEESPEC NATIVE_TRUE NATIVE_FALSE NEEDS_DATA_START_TRUE NEEDS_DATA_START_FALSE GCC_UNWIND_INCLUDE toolexecdir toolexecmainlibdir toolexeclibdir GCJVERSION ALLOCA PERL BACKTRACESPEC SYSDEP_SOURCES here LIBOBJS LTLIBOBJS'
ac_subst_files='' ac_subst_files=''
# Initialize some variables set by options. # Initialize some variables set by options.
@ -6328,6 +6328,21 @@ else
fi fi
case "$host" in
*-darwin*) DARWIN_CRT=true ;;
*) DARWIN_CRT=false ;;
esac
if $DARWIN_CRT; then
USING_DARWIN_CRT_TRUE=
USING_DARWIN_CRT_FALSE='#'
else
USING_DARWIN_CRT_TRUE='#'
USING_DARWIN_CRT_FALSE=
fi
# These may not be defined in a non-ANS conformant embedded system. # These may not be defined in a non-ANS conformant embedded system.
# FIXME: Should these case a runtime exception in that case? # FIXME: Should these case a runtime exception in that case?
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
@ -16433,6 +16448,13 @@ echo "$as_me: error: conditional \"USING_ECOS_PLATFORM\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;} Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi fi
if test -z "${USING_DARWIN_CRT_TRUE}" && test -z "${USING_DARWIN_CRT_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"USING_DARWIN_CRT\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
echo "$as_me: error: conditional \"USING_DARWIN_CRT\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${XLIB_AWT_TRUE}" && test -z "${XLIB_AWT_FALSE}"; then if test -z "${XLIB_AWT_TRUE}" && test -z "${XLIB_AWT_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"XLIB_AWT\" was never defined. { { echo "$as_me:$LINENO: error: conditional \"XLIB_AWT\" was never defined.
Usually this means the macro was only invoked conditionally." >&5 Usually this means the macro was only invoked conditionally." >&5
@ -17190,6 +17212,8 @@ s,@USING_POSIX_PLATFORM_TRUE@,$USING_POSIX_PLATFORM_TRUE,;t t
s,@USING_POSIX_PLATFORM_FALSE@,$USING_POSIX_PLATFORM_FALSE,;t t s,@USING_POSIX_PLATFORM_FALSE@,$USING_POSIX_PLATFORM_FALSE,;t t
s,@USING_ECOS_PLATFORM_TRUE@,$USING_ECOS_PLATFORM_TRUE,;t t s,@USING_ECOS_PLATFORM_TRUE@,$USING_ECOS_PLATFORM_TRUE,;t t
s,@USING_ECOS_PLATFORM_FALSE@,$USING_ECOS_PLATFORM_FALSE,;t t s,@USING_ECOS_PLATFORM_FALSE@,$USING_ECOS_PLATFORM_FALSE,;t t
s,@USING_DARWIN_CRT_TRUE@,$USING_DARWIN_CRT_TRUE,;t t
s,@USING_DARWIN_CRT_FALSE@,$USING_DARWIN_CRT_FALSE,;t t
s,@SYSTEMSPEC@,$SYSTEMSPEC,;t t s,@SYSTEMSPEC@,$SYSTEMSPEC,;t t
s,@LIBGCJTESTSPEC@,$LIBGCJTESTSPEC,;t t s,@LIBGCJTESTSPEC@,$LIBGCJTESTSPEC,;t t
s,@ZLIBSPEC@,$ZLIBSPEC,;t t s,@ZLIBSPEC@,$ZLIBSPEC,;t t

View file

@ -427,6 +427,12 @@ AM_CONDITIONAL(USING_WIN32_PLATFORM, test "$PLATFORM" = Win32)
AM_CONDITIONAL(USING_POSIX_PLATFORM, test "$PLATFORM" = Posix) AM_CONDITIONAL(USING_POSIX_PLATFORM, test "$PLATFORM" = Posix)
AM_CONDITIONAL(USING_ECOS_PLATFORM, test "$PLATFORM" = Ecos) AM_CONDITIONAL(USING_ECOS_PLATFORM, test "$PLATFORM" = Ecos)
case "$host" in
*-darwin*) DARWIN_CRT=true ;;
*) DARWIN_CRT=false ;;
esac
AM_CONDITIONAL(USING_DARWIN_CRT, $DARWIN_CRT)
# These may not be defined in a non-ANS conformant embedded system. # These may not be defined in a non-ANS conformant embedded system.
# FIXME: Should these case a runtime exception in that case? # FIXME: Should these case a runtime exception in that case?
AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME, 1, AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME, 1,

63
libjava/darwin.cc Normal file
View file

@ -0,0 +1,63 @@
/* darwin.cc - class loader stuff for Darwin. */
/* Copyright (C) 2004 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
#include <jvm.h>
/* In theory, we should be able to do:
#include <mach-o/getsect.h>
#include <mach-o/dyld.h>
but all the types in these headers changed between Panther and Tiger,
so the only way to be avoid type mismatches is to declare the routines
ourself. */
#include <stdint.h>
struct mach_header;
extern "C" void _dyld_register_func_for_add_image
(void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide));
extern "C" void _dyld_register_func_for_remove_image
(void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide));
extern "C" char *getsectdatafromheader
(const struct mach_header *mhp, const char *segname, const char *sectname,
uint32_t *size);
/* When a new image is loaded, look to see if it has a jcr section
and if so register the classes listed in it. */
static void
darwin_java_register_dyld_add_image_hook (const struct mach_header *mh,
intptr_t slide)
{
char *fde;
uint32_t sz;
fde = getsectdatafromheader (mh, "__DATA", "jcr", &sz);
if (! fde)
return;
/* As far as I can tell, you're only supposed to load shared
libraries while having a lock on java.lang.Class. So there's
no need to synchronize on anything here. (I'm not sure how exactly
you can ensure this given lazy library loading. FIXME.) */
_Jv_RegisterClasses_Counted ((const jclass *) (fde + slide),
sz / sizeof (jclass *));
}
static struct darwin_constructor_s{
darwin_constructor_s()
{
_dyld_register_func_for_add_image
(darwin_java_register_dyld_add_image_hook);
/* At present, you mustn't unload any java plugin. */
};
} darwin_constructor;

View file

@ -196,6 +196,8 @@ THREADSPEC = @THREADSPEC@
TOOLKIT = @TOOLKIT@ TOOLKIT = @TOOLKIT@
USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@ USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@
USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@ USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@
USING_DARWIN_CRT_FALSE = @USING_DARWIN_CRT_FALSE@
USING_DARWIN_CRT_TRUE = @USING_DARWIN_CRT_TRUE@
USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@ USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@
USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@ USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@
USING_GCC_FALSE = @USING_GCC_FALSE@ USING_GCC_FALSE = @USING_GCC_FALSE@

View file

@ -195,6 +195,8 @@ THREADSPEC = @THREADSPEC@
TOOLKIT = @TOOLKIT@ TOOLKIT = @TOOLKIT@
USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@ USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@
USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@ USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@
USING_DARWIN_CRT_FALSE = @USING_DARWIN_CRT_FALSE@
USING_DARWIN_CRT_TRUE = @USING_DARWIN_CRT_TRUE@
USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@ USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@
USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@ USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@
USING_GCC_FALSE = @USING_GCC_FALSE@ USING_GCC_FALSE = @USING_GCC_FALSE@

View file

@ -411,7 +411,9 @@ extern "C" void *_Jv_LookupInterfaceMethodIdx (jclass klass, jclass iface,
int meth_idx); int meth_idx);
extern "C" void _Jv_CheckArrayStore (jobject array, jobject obj); extern "C" void _Jv_CheckArrayStore (jobject array, jobject obj);
extern "C" void _Jv_RegisterClass (jclass klass); extern "C" void _Jv_RegisterClass (jclass klass);
extern "C" void _Jv_RegisterClasses (jclass *classes); extern "C" void _Jv_RegisterClasses (const jclass *classes);
extern "C" void _Jv_RegisterClasses_Counted (const jclass *classes,
size_t count);
extern "C" void _Jv_RegisterResource (void *vptr); extern "C" void _Jv_RegisterResource (void *vptr);
extern void _Jv_UnregisterClass (_Jv_Utf8Const*, java::lang::ClassLoader*); extern void _Jv_UnregisterClass (_Jv_Utf8Const*, java::lang::ClassLoader*);
extern void _Jv_ResolveField (_Jv_Field *, java::lang::ClassLoader*); extern void _Jv_ResolveField (_Jv_Field *, java::lang::ClassLoader*);

View file

@ -14,6 +14,7 @@ details. */
#pragma interface #pragma interface
#include <stddef.h>
#include <java/lang/Object.h> #include <java/lang/Object.h>
#include <java/lang/String.h> #include <java/lang/String.h>
#include <java/net/URL.h> #include <java/net/URL.h>
@ -24,7 +25,9 @@ details. */
// We declare these here to avoid including gcj/cni.h. // We declare these here to avoid including gcj/cni.h.
extern "C" void _Jv_InitClass (jclass klass); extern "C" void _Jv_InitClass (jclass klass);
extern "C" void _Jv_RegisterClasses (jclass *classes); extern "C" void _Jv_RegisterClasses (const jclass *classes);
extern "C" void _Jv_RegisterClasses_Counted (const jclass *classes,
size_t count);
// This must be predefined with "C" linkage. // This must be predefined with "C" linkage.
extern "C" void *_Jv_LookupInterfaceMethodIdx (jclass klass, jclass iface, extern "C" void *_Jv_LookupInterfaceMethodIdx (jclass klass, jclass iface,
@ -310,7 +313,9 @@ private:
friend class java::io::ObjectStreamClass; friend class java::io::ObjectStreamClass;
friend void _Jv_WaitForState (jclass, int); friend void _Jv_WaitForState (jclass, int);
friend void _Jv_RegisterClasses (jclass *classes); friend void _Jv_RegisterClasses (const jclass *classes);
friend void _Jv_RegisterClasses_Counted (const jclass *classes,
size_t count);
friend void _Jv_RegisterClassHookDefault (jclass klass); friend void _Jv_RegisterClassHookDefault (jclass klass);
friend void _Jv_RegisterInitiatingLoader (jclass,java::lang::ClassLoader*); friend void _Jv_RegisterInitiatingLoader (jclass,java::lang::ClassLoader*);
friend void _Jv_UnregisterClass (jclass); friend void _Jv_UnregisterClass (jclass);

View file

@ -316,7 +316,7 @@ _Jv_RegisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader)
// class chain. At all other times, the caller should synchronize on // class chain. At all other times, the caller should synchronize on
// Class::class$. // Class::class$.
void void
_Jv_RegisterClasses (jclass *classes) _Jv_RegisterClasses (const jclass *classes)
{ {
for (; *classes; ++classes) for (; *classes; ++classes)
{ {
@ -331,6 +331,24 @@ _Jv_RegisterClasses (jclass *classes)
} }
} }
// This is a version of _Jv_RegisterClasses that takes a count.
void
_Jv_RegisterClasses_Counted (const jclass * classes, size_t count)
{
size_t i;
for (i = 0; i < count; i++)
{
jclass klass = classes[i];
(*_Jv_RegisterClassHook) (klass);
// registering a compiled class causes
// it to be immediately "prepared".
if (klass->state == JV_STATE_NOTHING)
klass->state = JV_STATE_COMPILED;
}
}
void void
_Jv_RegisterClassHookDefault (jclass klass) _Jv_RegisterClassHookDefault (jclass klass)
{ {

View file

@ -184,6 +184,8 @@ THREADSPEC = @THREADSPEC@
TOOLKIT = @TOOLKIT@ TOOLKIT = @TOOLKIT@
USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@ USING_BOEHMGC_FALSE = @USING_BOEHMGC_FALSE@
USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@ USING_BOEHMGC_TRUE = @USING_BOEHMGC_TRUE@
USING_DARWIN_CRT_FALSE = @USING_DARWIN_CRT_FALSE@
USING_DARWIN_CRT_TRUE = @USING_DARWIN_CRT_TRUE@
USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@ USING_ECOS_PLATFORM_FALSE = @USING_ECOS_PLATFORM_FALSE@
USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@ USING_ECOS_PLATFORM_TRUE = @USING_ECOS_PLATFORM_TRUE@
USING_GCC_FALSE = @USING_GCC_FALSE@ USING_GCC_FALSE = @USING_GCC_FALSE@

View file

@ -1,3 +1,14 @@
2004-10-25 Geoffrey Keating <geoffk@apple.com>
* libsupc++/new_op.cc (new): Make weak.
* libsupc++/new_opnt.cc (new): Make weak.
* libsupc++/new_opv.cc (new): Make weak.
* libsupc++/new_opvnt.cc (new): Make weak.
* libsupc++/delete_op.cc (delete): Make weak.
* libsupc++/delete_opnt.cc (delete): Make weak.
* libsupc++/delete_opv.cc (delete): Make weak.
* libsupc++/delete_opvnt.cc (delete): Make weak.
2004-10-25 Benjamin Kosnik <bkoz@redhat.com> 2004-10-25 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/Makefile.am (GLIBCXX_INCLUDES): Add. * testsuite/Makefile.am (GLIBCXX_INCLUDES): Add.

View file

@ -172,6 +172,13 @@ case "${host_os}" in
cygwin*) cygwin*)
os_include_dir="os/newlib" os_include_dir="os/newlib"
;; ;;
darwin*)
# On Darwin, performance is improved if libstdc++ is single-module.
# Up to at least 10.3.5, -flat_namespace is required for proper
# treatment of coalesced symbols.
OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
os_include_dir="os/generic"
;;
*djgpp*) # leading * picks up "msdosdjgpp" *djgpp*) # leading * picks up "msdosdjgpp"
os_include_dir="os/djgpp" os_include_dir="os/djgpp"
;; ;;

View file

@ -39,7 +39,7 @@ using std::free;
extern "C" void free(void *); extern "C" void free(void *);
#endif #endif
void __attribute__((weak)) void
operator delete (void *ptr) throw () operator delete (void *ptr) throw ()
{ {
if (ptr) if (ptr)

View file

@ -32,7 +32,7 @@
extern "C" void free (void *); extern "C" void free (void *);
void __attribute__((weak)) void
operator delete (void *ptr, const std::nothrow_t&) throw () operator delete (void *ptr, const std::nothrow_t&) throw ()
{ {
if (ptr) if (ptr)

View file

@ -30,7 +30,7 @@
#include "new" #include "new"
void __attribute__((weak)) void
operator delete[] (void *ptr) throw () operator delete[] (void *ptr) throw ()
{ {
::operator delete (ptr); ::operator delete (ptr);

View file

@ -30,7 +30,7 @@
#include "new" #include "new"
void __attribute__((weak)) void
operator delete[] (void *ptr, const std::nothrow_t&) throw () operator delete[] (void *ptr, const std::nothrow_t&) throw ()
{ {
::operator delete (ptr); ::operator delete (ptr);

View file

@ -43,7 +43,7 @@ extern "C" void *malloc (std::size_t);
extern new_handler __new_handler; extern new_handler __new_handler;
void * __attribute__((weak)) void *
operator new (std::size_t sz) throw (std::bad_alloc) operator new (std::size_t sz) throw (std::bad_alloc)
{ {
void *p; void *p;

View file

@ -36,7 +36,7 @@ using std::bad_alloc;
extern "C" void *malloc (std::size_t); extern "C" void *malloc (std::size_t);
extern new_handler __new_handler; extern new_handler __new_handler;
void * __attribute__((weak)) void *
operator new (std::size_t sz, const std::nothrow_t&) throw() operator new (std::size_t sz, const std::nothrow_t&) throw()
{ {
void *p; void *p;

View file

@ -30,7 +30,7 @@
#include "new" #include "new"
void * __attribute__((weak)) void *
operator new[] (std::size_t sz) throw (std::bad_alloc) operator new[] (std::size_t sz) throw (std::bad_alloc)
{ {
return ::operator new(sz); return ::operator new(sz);

View file

@ -30,7 +30,7 @@
#include "new" #include "new"
void * __attribute__((weak)) void *
operator new[] (std::size_t sz, const std::nothrow_t& nothrow) throw() operator new[] (std::size_t sz, const std::nothrow_t& nothrow) throw()
{ {
return ::operator new(sz, nothrow); return ::operator new(sz, nothrow);