+2002-09-10 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.c (rs6000_assemble_visibility): Protect declaration
+ inside macro. Correct function definition typo.
+ (rs6000_xcoff_section_type_flags): New function.
+ (TARGET_SECTION_TYPE_FLAGS): Remove definition.
+ (rs6000_elf_section_type_flags): Call default_section_type_flags_1
+ with appropriate PIC test.
+ (rs6000_xcoff_select_section): Use decl_readonly_section_1 to
+ determine readonly.
+ (rs6000_binds_local_p): Combine PIC flags.
+ * sysv4.h (TARGET_SECTION_TYPE_FLAGS): Define.
+ * xcoff.h (TARGET_SECTION_TYPE_FLAGS): Define.
+
2002-09-09 Per Bothner <per@bothner.com>
* print-tree.c (print_node): In a STRING_CST, escape non-ascii
static int constant_pool_expr_1 PARAMS ((rtx, int *, int *));
static struct machine_function * rs6000_init_machine_status PARAMS ((void));
static bool rs6000_assemble_integer PARAMS ((rtx, unsigned int, int));
+#ifdef HAVE_GAS_HIDDEN
static void rs6000_assemble_visibility PARAMS ((tree, const char *));
+#endif
static int rs6000_ra_ever_killed PARAMS ((void));
static tree rs6000_handle_longcall_attribute PARAMS ((tree *, tree, tree, int, bool *));
const struct attribute_spec rs6000_attribute_table[];
static void rs6000_xcoff_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
static const char * rs6000_xcoff_strip_name_encoding PARAMS ((const char *));
+static unsigned int rs6000_xcoff_section_type_flags PARAMS ((tree, const char *, int));
#endif
static void rs6000_xcoff_encode_section_info PARAMS ((tree, int))
ATTRIBUTE_UNUSED;
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE rs6000_output_function_epilogue
-#if TARGET_ELF
-#undef TARGET_SECTION_TYPE_FLAGS
-#define TARGET_SECTION_TYPE_FLAGS rs6000_elf_section_type_flags
-#endif
-
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE rs6000_issue_rate
#undef TARGET_SCHED_ADJUST_COST
/* Emit an assembler directive to set symbol visibility for DECL to
VISIBILITY_TYPE. */
-void
+static void
rs6000_assemble_visibility (decl, visibility_type)
tree decl;
const char *visibility_type;
const char *name;
int reloc;
{
- unsigned int flags = default_section_type_flags (decl, name, reloc);
+ unsigned int flags
+ = default_section_type_flags_1 (decl, name, reloc,
+ flag_pic || DEFAULT_ABI == ABI_AIX);
if (TARGET_RELOCATABLE)
flags |= SECTION_WRITE;
int reloc;
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
{
- bool readonly = false;
-
- if (TREE_CODE (decl) == STRING_CST)
- readonly = !flag_writable_strings;
- else if (TREE_CODE (decl) == VAR_DECL)
- readonly = (!reloc
- && TREE_READONLY (decl)
- && !TREE_SIDE_EFFECTS (decl)
- && DECL_INITIAL (decl)
- && DECL_INITIAL (decl) != error_mark_node
- && TREE_CONSTANT (DECL_INITIAL (decl)));
- else if (TREE_CODE (decl) == CONSTRUCTOR)
- readonly = (!reloc
- && !TREE_SIDE_EFFECTS (decl)
- && TREE_CONSTANT (decl));
- else
- readonly = !reloc;
-
- if (readonly)
+ if (decl_readonly_section_1 (decl, reloc, 1))
{
if (TREE_PUBLIC (decl))
read_only_data_section ();
return name;
}
+/* Section attributes. AIX is always PIC. */
+
+static unsigned int
+rs6000_xcoff_section_type_flags (decl, name, reloc)
+ tree decl;
+ const char *name;
+ int reloc;
+{
+ return default_section_type_flags_1 (decl, name, reloc, 1);
+}
+
#endif /* TARGET_XCOFF */
/* Note that this is also used for PPC64 Linux. */
rs6000_binds_local_p (decl)
tree decl;
{
- if (DEFAULT_ABI == ABI_AIX)
- return default_binds_local_p_1 (decl, rs6000_flag_pic);
- else
- return default_binds_local_p_1 (decl, flag_pic);
+ return default_binds_local_p_1 (decl, flag_pic || rs6000_flag_pic);
}
|| (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& ! TARGET_NO_FP_IN_TOC)))))
+#define TARGET_ASM_GLOBALIZE_LABEL rs6000_xcoff_asm_globalize_label
+#define TARGET_ASM_NAMED_SECTION rs6000_xcoff_asm_named_section
+#define TARGET_ASM_SELECT_SECTION rs6000_xcoff_select_section
#define TARGET_ASM_SELECT_RTX_SECTION rs6000_xcoff_select_rtx_section
+#define TARGET_ASM_UNIQUE_SECTION rs6000_xcoff_unique_section
#define TARGET_ENCODE_SECTION_INFO rs6000_xcoff_encode_section_info
#define TARGET_STRIP_NAME_ENCODING rs6000_xcoff_strip_name_encoding
+#define TARGET_SECTION_TYPE_FLAGS rs6000_xcoff_section_type_flags
/* FP save and restore routines. */
#define SAVE_FP_PREFIX "._savef"
Align entire section to BIGGEST_ALIGNMENT. */
#define DATA_SECTION_ASM_OP "\t.csect .data[RW],3"
-/* Define unique section name -- functions only. */
-#define TARGET_ASM_UNIQUE_SECTION rs6000_xcoff_unique_section
-
-/* Switch into a generic section. */
-#define TARGET_ASM_NAMED_SECTION rs6000_xcoff_asm_named_section
-
-/* Globalize a label. */
-#define TARGET_ASM_GLOBALIZE_LABEL rs6000_xcoff_asm_globalize_label
-
/* Define the name of the section to use for the EH language specific
data areas (.gcc_except_table on most other systems). */
#define TARGET_ASM_EXCEPTION_SECTION data_section