This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Committed, MMIX: Fix ENCODE_SECTION_INFO and .hidden fallout
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 Mar 2002 21:19:44 -0500 (EST)
- Subject: Committed, MMIX: Fix ENCODE_SECTION_INFO and .hidden fallout
The MMIX definition of ENCODE_SECTION_INFO wasn't tweaked
together with the other definitions. Handling of "-r" was not
implemented in LINK_SPEC. I'll commit the fix for "-r" to 3.1
too.
* config/mmix/mmix.h (ENCODE_SECTION_INFO): Pass on new second
parameter to mmix_encode_section_info.
(LINK_SPEC): Don't defsym __.MMIX.start..text if linking
relocatably. Always produce ELF, not mmo if linking relocatably.
* config/mmix/mmix.c (mmix_encode_section_info): If new parameter
first is non-zero, don't add symbol prefix.
* config/mmix/mmix-protos.h (mmix_encode_section_info): Tweak
prototype accordingly.
Index: mmix-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix-protos.h,v
retrieving revision 1.6
diff -p -c -r1.6 mmix-protos.h
*** mmix-protos.h 2002/01/10 01:23:07 1.6
--- mmix-protos.h 2002/03/05 01:58:22
*************** extern int mmix_local_alignment PARAMS (
*** 75,81 ****
extern void mmix_setup_incoming_varargs
PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int));
extern void mmix_select_section PARAMS ((tree, int, int));
! extern void mmix_encode_section_info PARAMS ((tree));
extern void mmix_unique_section PARAMS ((tree, int));
extern void mmix_asm_output_pool_prologue
PARAMS ((FILE *, const char *, tree, int));
--- 75,81 ----
extern void mmix_setup_incoming_varargs
PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int));
extern void mmix_select_section PARAMS ((tree, int, int));
! extern void mmix_encode_section_info PARAMS ((tree, int));
extern void mmix_unique_section PARAMS ((tree, int));
extern void mmix_asm_output_pool_prologue
PARAMS ((FILE *, const char *, tree, int));
Index: mmix.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.c,v
retrieving revision 1.19
diff -p -c -r1.19 mmix.c
*** mmix.c 2002/03/03 14:07:37 1.19
--- mmix.c 2002/03/05 01:58:23
*************** mmix_select_section (decl, reloc, align)
*** 1695,1709 ****
/* ENCODE_SECTION_INFO. */
void
! mmix_encode_section_info (decl)
tree decl;
{
/* Test for an external declaration, and do nothing if it is one. */
if ((TREE_CODE (decl) == VAR_DECL
&& (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL && TREE_PUBLIC (decl)))
;
! else if (DECL_P (decl))
{
/* For non-visible declarations, add a "@" prefix, which we skip
when the label is output. If the label does not have this
--- 1695,1710 ----
/* ENCODE_SECTION_INFO. */
void
! mmix_encode_section_info (decl, first)
tree decl;
+ int first;
{
/* Test for an external declaration, and do nothing if it is one. */
if ((TREE_CODE (decl) == VAR_DECL
&& (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL && TREE_PUBLIC (decl)))
;
! else if (first && DECL_P (decl))
{
/* For non-visible declarations, add a "@" prefix, which we skip
when the label is output. If the label does not have this
Index: mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.18
diff -p -c -r1.18 mmix.h
*** mmix.h 2002/03/03 21:10:01 1.18
--- mmix.h 2002/03/05 01:58:24
*************** struct machine_function
*** 119,131 ****
/* Pass on -mset-program-start=N and -mset-data-start=M to the linker.
Provide default program start 0x100 unless -mno-set-program-start.
! Link to ELF if requested. */
#define LINK_SPEC \
"%{mset-program-start=*:--defsym __.MMIX.start..text=%*}\
%{mset-data-start=*:--defsym __.MMIX.start..data=%*}\
%{!mset-program-start=*:\
! %{!mno-set-program-start:--defsym __.MMIX.start..text=0x100}}\
! %{!melf:-m mmo}%{melf:-m elf64mmix}"
/* Put unused option values here. */
extern const char *mmix_cc1_ignored_option;
--- 119,133 ----
/* Pass on -mset-program-start=N and -mset-data-start=M to the linker.
Provide default program start 0x100 unless -mno-set-program-start.
! Don't do this if linking relocatably, with -r. For a final link,
! produce mmo, unless ELF is requested or when linking relocatably. */
#define LINK_SPEC \
"%{mset-program-start=*:--defsym __.MMIX.start..text=%*}\
%{mset-data-start=*:--defsym __.MMIX.start..data=%*}\
%{!mset-program-start=*:\
! %{!mno-set-program-start:\
! %{!r:--defsym __.MMIX.start..text=0x100}}}\
! %{!melf:%{!r:-m mmo}}%{melf|r:-m elf64mmix}"
/* Put unused option values here. */
extern const char *mmix_cc1_ignored_option;
*************** const_section () \
*** 937,944 ****
#define SELECT_SECTION(DECL, RELOC, ALIGN) \
mmix_select_section (DECL, RELOC, ALIGN)
! #define ENCODE_SECTION_INFO(DECL) \
! mmix_encode_section_info (DECL)
#define STRIP_NAME_ENCODING(VAR, SYM_NAME) \
(VAR) = mmix_strip_name_encoding (SYM_NAME)
--- 939,946 ----
#define SELECT_SECTION(DECL, RELOC, ALIGN) \
mmix_select_section (DECL, RELOC, ALIGN)
! #define ENCODE_SECTION_INFO(DECL, FIRST) \
! mmix_encode_section_info (DECL, FIRST)
#define STRIP_NAME_ENCODING(VAR, SYM_NAME) \
(VAR) = mmix_strip_name_encoding (SYM_NAME)
brgds, H-P