From: Kaveh R. Ghazi Date: Tue, 23 Oct 2001 22:39:06 +0000 (+0000) Subject: darwin-protos.h (constructor_section, [...]): Prototype. X-Git-Tag: prereleases/libstdc++-3.0.95~1451 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91dc3130bf8964ab890918269fc3f69539c42bb8;p=thirdparty%2Fgcc.git darwin-protos.h (constructor_section, [...]): Prototype. * darwin-protos.h (constructor_section, destructor_section, mod_init_section, mod_term_section): Prototype. * darwin.c (machopic_finish, update_non_lazy_ptrs, update_stubs): Const-ify. * darwin.h (ASM_DECLARE_OBJECT_NAME, ASM_DECLARE_FUNCTION_NAME): Likewise. (SECTION_FUNCTION): Prototype `FUNCTION'. Delete objc_section_init declaration. (EXTRA_SECTION_FUNCTIONS): Prototype objc_section_init. (objc_section_init, try_section_alias): Make static. (alias_section): Make static and hide unused function. (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warning. From-SVN: r46447 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6272d5bab1c0..36e9e695c54c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2001-10-23 Kaveh R. Ghazi + + * darwin-protos.h (constructor_section, destructor_section, + mod_init_section, mod_term_section): Prototype. + * darwin.c (machopic_finish, update_non_lazy_ptrs, update_stubs): + Const-ify. + * darwin.h (ASM_DECLARE_OBJECT_NAME, ASM_DECLARE_FUNCTION_NAME): + Likewise. + (SECTION_FUNCTION): Prototype `FUNCTION'. Delete + objc_section_init declaration. + (EXTRA_SECTION_FUNCTIONS): Prototype objc_section_init. + (objc_section_init, try_section_alias): Make static. + (alias_section): Make static and hide unused function. + (ASM_GENERATE_INTERNAL_LABEL): Fix format specifier warning. + Tue Oct 23 13:05:53 2001 Richard Kenner * alias.c (can_address_p): Compnonents are not addressable if diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h index 3b7ce74dc57f..208d93fb7db3 100644 --- a/gcc/config/darwin-protos.h +++ b/gcc/config/darwin-protos.h @@ -33,6 +33,11 @@ extern void machopic_symbol_stub_section PARAMS ((void)); extern void machopic_lazy_symbol_ptr_section PARAMS ((void)); extern void machopic_nl_symbol_ptr_section PARAMS ((void)); +extern void constructor_section PARAMS ((void)); +extern void destructor_section PARAMS ((void)); +extern void mod_init_section PARAMS ((void)); +extern void mod_term_section PARAMS ((void)); + #ifdef RTX_CODE extern int machopic_operand_p PARAMS ((rtx)); diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index fe0852813df1..158f375c4cba 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -885,8 +885,8 @@ machopic_finish (asm_out_file) temp != NULL_TREE; temp = TREE_CHAIN (temp)) { - char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - char *stub_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp)); + const char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); + const char *stub_name = IDENTIFIER_POINTER (TREE_PURPOSE (temp)); char *sym; char *stub; @@ -1066,7 +1066,7 @@ static void update_non_lazy_ptrs (name) const char *name; { - char *name1, *name2; + const char *name1, *name2; tree temp; STRIP_NAME_ENCODING (name1, name); @@ -1097,7 +1097,7 @@ static void update_stubs (name) const char *name; { - char *name1, *name2; + const char *name1, *name2; tree temp; STRIP_NAME_ENCODING (name1, name); diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 35207af26d5d..a7a96f31ff35 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -204,7 +204,7 @@ do { text_section (); \ #undef ASM_DECLARE_OBJECT_NAME #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ do { \ - char *xname = NAME; \ + const char *xname = NAME; \ if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ if ((TREE_STATIC (DECL) \ @@ -220,7 +220,7 @@ do { text_section (); \ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ do { \ - char *xname = NAME; \ + const char *xname = NAME; \ if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF) \ xname = IDENTIFIER_POINTER (DECL_NAME (DECL)); \ if ((TREE_STATIC (DECL) \ @@ -310,11 +310,10 @@ do { text_section (); \ #undef SECTION_FUNCTION #define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, OBJC) \ +extern void FUNCTION PARAMS ((void)); \ void \ FUNCTION () \ { \ - extern void objc_section_init (); \ - \ if (in_section != SECTION) \ { \ if (OBJC) \ @@ -357,6 +356,7 @@ do { if (!strcmp (alias_name, name)) \ #undef EXTRA_SECTION_FUNCTIONS #define EXTRA_SECTION_FUNCTIONS \ +static void objc_section_init PARAMS ((void)); \ SECTION_FUNCTION (const_section, \ in_const, \ ".const", 0) \ @@ -464,7 +464,7 @@ SECTION_FUNCTION (darwin_eh_frame_section, \ in_darwin_eh_frame, \ ".section __TEXT,__eh_frame", 0) \ \ -void \ +static void \ objc_section_init () \ { \ static int been_here = 0; \ @@ -497,14 +497,18 @@ objc_section_init () \ } \ } \ static tree section_alias[(int) num_sections]; \ -void try_section_alias () \ +static void try_section_alias PARAMS ((void)); \ +static void try_section_alias () \ { \ if (section_alias[in_section] && asm_out_file) \ fprintf (asm_out_file, "%s\n", \ IDENTIFIER_POINTER (section_alias[in_section])); \ } \ -void alias_section (name, alias) \ - char *name, *alias; \ + +#if 0 +static void alias_section PARAMS ((const char *, const char *)); \ +static void alias_section (name, alias) \ + const char *name, *alias; \ { \ ALIAS_SECTION (in_data, "data"); \ ALIAS_SECTION (in_text, "text"); \ @@ -514,6 +518,7 @@ void alias_section (name, alias) \ ALIAS_SECTION (in_literal4, "literal4"); \ ALIAS_SECTION (in_literal8, "literal8"); \ } +#endif #undef READONLY_DATA_SECTION #define READONLY_DATA_SECTION const_section @@ -685,7 +690,7 @@ void alias_section (name, alias) \ #undef ASM_GENERATE_INTERNAL_LABEL #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ - sprintf (LABEL, "*%s%d", PREFIX, NUM) + sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)) /* This is how to output an internal numbered label where PREFIX is the class of label and NUM is the number within the class. */