aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/config/darwin-protos.h5
-rw-r--r--gcc/config/darwin.c8
-rw-r--r--gcc/config/darwin.h23
4 files changed, 38 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6272d5b..36e9e69 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2001-10-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 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 <kenner@vlsi1.ultra.nyu.edu>
* 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 3b7ce74..208d93f 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 fe08528..158f375 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 35207af..a7a96f3 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. */