Commit 774acadf by Zack Weinberg Committed by John David Anglin

pa-protos.h (readonly_data, [...]): Rename to som_readonly_data_section...

        * config/pa/pa-protos.h (readonly_data, one_only_readonly_data_section,
	one_only_data_section): Rename to som_readonly_data_section,
	som_one_only_readonly_data_section and som_one_only_data_section.
        * config/pa/pa.c (ONE_ONLY_TEXT_SECTION_ASM_OP, NEW_TEXT_SECTION_ASM_OP,
	DEFAULT_TEXT_SECTION_ASM_OP): Delete conditional defines.
	(som_text_section_asm_op): Replace ONE_ONLY_TEXT_SECTION_ASM_OP,
	NEW_TEXT_SECTION_ASM_OP and DEFAULT_TEXT_SECTION_ASM_OP with actual
	string values.
	(pa_select_section): Use renamed section functions.
	* config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS,
        SOM_READONLY_DATA_SECTION_FUNCTION,
	SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION,
        SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION):
        Define here ...
        * config/pa/som.h: ... not here.
        (DEFAULT_TEXT_SECTION_ASM_OP, NEW_TEXT_SECTION_ASM_OP,
	ONE_ONLY_TEXT_SECTION_ASM_OP, READONLY_DATA_ASM_OP,
	ONE_ONLY_READONLY_DATA_SECTION_ASM_OP,
        ONE_ONLY_DATA_SECTION_ASM_OP): Delete.
        (READONLY_DATA_SECTION): Use som_readonly_data_section.

Co-Authored-By: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>

From-SVN: r86325
parent 888705fb
2004-08-20 Zack Weinberg <zack@codesourcery.com>
John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* config/pa/pa-protos.h (readonly_data, one_only_readonly_data_section,
one_only_data_section): Rename to som_readonly_data_section,
som_one_only_readonly_data_section and som_one_only_data_section.
* config/pa/pa.c (ONE_ONLY_TEXT_SECTION_ASM_OP, NEW_TEXT_SECTION_ASM_OP,
DEFAULT_TEXT_SECTION_ASM_OP): Delete conditional defines.
(som_text_section_asm_op): Replace ONE_ONLY_TEXT_SECTION_ASM_OP,
NEW_TEXT_SECTION_ASM_OP and DEFAULT_TEXT_SECTION_ASM_OP with actual
string values.
(pa_select_section): Use renamed section functions.
* config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS,
SOM_READONLY_DATA_SECTION_FUNCTION,
SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION,
SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION):
Define here ...
* config/pa/som.h: ... not here.
(DEFAULT_TEXT_SECTION_ASM_OP, NEW_TEXT_SECTION_ASM_OP,
ONE_ONLY_TEXT_SECTION_ASM_OP, READONLY_DATA_ASM_OP,
ONE_ONLY_READONLY_DATA_SECTION_ASM_OP,
ONE_ONLY_DATA_SECTION_ASM_OP): Delete.
(READONLY_DATA_SECTION): Use som_readonly_data_section.
2004-08-20 Nathan Sidwell <nathan@codesourcery.com> 2004-08-20 Nathan Sidwell <nathan@codesourcery.com>
* fold-const.c (int_const_binop): Don't generate non-overflowing * fold-const.c (int_const_binop): Don't generate non-overflowing
......
...@@ -177,7 +177,7 @@ extern void pa_asm_output_aligned_local (FILE *, const char *, ...@@ -177,7 +177,7 @@ extern void pa_asm_output_aligned_local (FILE *, const char *,
unsigned int); unsigned int);
/* Functions in varasm.c used by pa.c. */ /* Functions in varasm.c used by pa.c. */
extern void readonly_data (void); extern void som_readonly_data_section (void);
extern void one_only_readonly_data_section (void); extern void som_one_only_readonly_data_section (void);
extern void one_only_data_section (void); extern void som_one_only_data_section (void);
extern void forget_section (void); extern void forget_section (void);
...@@ -9236,27 +9236,18 @@ cmpib_comparison_operator (rtx op, enum machine_mode mode) ...@@ -9236,27 +9236,18 @@ cmpib_comparison_operator (rtx op, enum machine_mode mode)
|| GET_CODE (op) == LEU)); || GET_CODE (op) == LEU));
} }
#ifndef ONE_ONLY_TEXT_SECTION_ASM_OP /* Return a string to output before text in the current function.
#define ONE_ONLY_TEXT_SECTION_ASM_OP ""
#endif
#ifndef NEW_TEXT_SECTION_ASM_OP
#define NEW_TEXT_SECTION_ASM_OP ""
#endif
#ifndef DEFAULT_TEXT_SECTION_ASM_OP
#define DEFAULT_TEXT_SECTION_ASM_OP ""
#endif
/* Select and return a TEXT_SECTION_ASM_OP for the current function.
This function is only used with SOM. Because we don't support This function is only used with SOM. Because we don't support
named subspaces, we can only create a new subspace or switch back named subspaces, we can only create a new subspace or switch back
into the default text subspace. */ to the default text subspace. */
const char * const char *
som_text_section_asm_op (void) som_text_section_asm_op (void)
{ {
if (TARGET_SOM && TARGET_GAS) if (!TARGET_SOM)
return "";
if (TARGET_GAS)
{ {
if (cfun && !cfun->machine->in_nsubspa) if (cfun && !cfun->machine->in_nsubspa)
{ {
...@@ -9269,9 +9260,10 @@ som_text_section_asm_op (void) ...@@ -9269,9 +9260,10 @@ som_text_section_asm_op (void)
if (cfun->decl if (cfun->decl
&& DECL_ONE_ONLY (cfun->decl) && DECL_ONE_ONLY (cfun->decl)
&& !DECL_WEAK (cfun->decl)) && !DECL_WEAK (cfun->decl))
return ONE_ONLY_TEXT_SECTION_ASM_OP; return
"\t.SPACE $TEXT$\n\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,SORT=24,COMDAT";
return NEW_TEXT_SECTION_ASM_OP; return "\t.SPACE $TEXT$\n\t.NSUBSPA $CODE$";
} }
else else
{ {
...@@ -9279,13 +9271,13 @@ som_text_section_asm_op (void) ...@@ -9279,13 +9271,13 @@ som_text_section_asm_op (void)
function has been completed. So, we are changing to the function has been completed. So, we are changing to the
text section to output debugging information. Do this in text section to output debugging information. Do this in
the default text section. We need to forget that we are the default text section. We need to forget that we are
in the text section so that text_section will call us the in the text section so that the function text_section in
next time around. */ varasm.c will call us the next time around. */
forget_section (); forget_section ();
} }
} }
return DEFAULT_TEXT_SECTION_ASM_OP; return "\t.SPACE $TEXT$\n\t.SUBSPA $CODE$";
} }
/* On hpux10, the linker will give an error if we have a reference /* On hpux10, the linker will give an error if we have a reference
...@@ -9308,7 +9300,7 @@ pa_select_section (tree exp, int reloc, ...@@ -9308,7 +9300,7 @@ pa_select_section (tree exp, int reloc,
if (TARGET_SOM if (TARGET_SOM
&& DECL_ONE_ONLY (exp) && DECL_ONE_ONLY (exp)
&& !DECL_WEAK (exp)) && !DECL_WEAK (exp))
one_only_readonly_data_section (); som_one_only_readonly_data_section ();
else else
readonly_data_section (); readonly_data_section ();
} }
...@@ -9320,7 +9312,7 @@ pa_select_section (tree exp, int reloc, ...@@ -9320,7 +9312,7 @@ pa_select_section (tree exp, int reloc,
&& DECL_ONE_ONLY (exp) && DECL_ONE_ONLY (exp)
&& !DECL_WEAK (exp) && !DECL_WEAK (exp)
&& DECL_INITIAL (exp)) && DECL_INITIAL (exp))
one_only_data_section (); som_one_only_data_section ();
else else
data_section (); data_section ();
} }
......
...@@ -1653,12 +1653,78 @@ do { \ ...@@ -1653,12 +1653,78 @@ do { \
goto LABEL goto LABEL
#define TARGET_ASM_SELECT_SECTION pa_select_section #define TARGET_ASM_SELECT_SECTION pa_select_section
/* Return a nonzero value if DECL has a section attribute. */ /* Return a nonzero value if DECL has a section attribute. */
#define IN_NAMED_SECTION_P(DECL) \ #define IN_NAMED_SECTION_P(DECL) \
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \ ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
&& DECL_SECTION_NAME (DECL) != NULL_TREE) && DECL_SECTION_NAME (DECL) != NULL_TREE)
/* The following extra sections and extra section functions are only used
for SOM, but they must be provided unconditionally because pa.c's calls
to the functions might not get optimized out when other object formats
are in use. */
#define EXTRA_SECTIONS \
in_som_readonly_data, \
in_som_one_only_readonly_data, \
in_som_one_only_data
#define EXTRA_SECTION_FUNCTIONS \
SOM_READONLY_DATA_SECTION_FUNCTION \
SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION \
SOM_ONE_ONLY_DATA_SECTION_FUNCTION \
FORGET_SECTION_FUNCTION
/* SOM puts readonly data in the default $LIT$ subspace when PIC code
is not being generated. */
#define SOM_READONLY_DATA_SECTION_FUNCTION \
void \
som_readonly_data_section (void) \
{ \
if (!TARGET_SOM) \
return; \
if (in_section != in_som_readonly_data) \
{ \
in_section = in_som_readonly_data; \
fputs ("\t.SPACE $TEXT$\n\t.SUBSPA $LIT$\n", asm_out_file); \
} \
}
/* When secondary definitions are not supported, SOM makes readonly data one
only by creating a new $LIT$ subspace in $TEXT$ with the comdat flag. */
#define SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION \
void \
som_one_only_readonly_data_section (void) \
{ \
if (!TARGET_SOM) \
return; \
in_section = in_som_one_only_readonly_data; \
fputs ("\t.SPACE $TEXT$\n" \
"\t.NSUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16,COMDAT\n",\
asm_out_file); \
}
/* When secondary definitions are not supported, SOM makes data one only by
creating a new $DATA$ subspace in $PRIVATE$ with the comdat flag. */
#define SOM_ONE_ONLY_DATA_SECTION_FUNCTION \
void \
som_one_only_data_section (void) \
{ \
if (!TARGET_SOM) \
return; \
in_section = in_som_one_only_data; \
fputs ("\t.SPACE $PRIVATE$\n" \
"\t.NSUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31,SORT=24,COMDAT\n", \
asm_out_file); \
}
#define FORGET_SECTION_FUNCTION \
void \
forget_section (void) \
{ \
in_section = no_section; \
}
/* Define this macro if references to a symbol must be treated /* Define this macro if references to a symbol must be treated
differently depending on something about the variable or differently depending on something about the variable or
function named by the symbol (such as what section it is in). function named by the symbol (such as what section it is in).
......
...@@ -206,84 +206,15 @@ do { \ ...@@ -206,84 +206,15 @@ do { \
#define TARGET_ASM_FILE_START pa_som_file_start #define TARGET_ASM_FILE_START pa_som_file_start
/* Select and return a TEXT_SECTION_ASM_OP string. */ /* String to output before text. */
#define TEXT_SECTION_ASM_OP som_text_section_asm_op () #define TEXT_SECTION_ASM_OP som_text_section_asm_op ()
/* Output before code in the default text section. */ /* String to output before writable data. */
#define DEFAULT_TEXT_SECTION_ASM_OP "\t.SPACE $TEXT$\n\t.SUBSPA $CODE$"
/* Output before text in a new subspace. This allows the linker to
place stubs between functions. */
#define NEW_TEXT_SECTION_ASM_OP "\t.SPACE $TEXT$\n\t.NSUBSPA $CODE$"
/* Output before text in a new one-only subspace. */
#define ONE_ONLY_TEXT_SECTION_ASM_OP "\t.SPACE $TEXT$\n\
\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,SORT=24,COMDAT"
/* Output before read-only data. */
#define READONLY_DATA_ASM_OP "\t.SPACE $TEXT$\n\t.SUBSPA $LIT$\n"
/* Output before one-only readonly data. We make readonly data one only
by creating a new $LIT$ subspace in $TEXT$ with the comdat flag. */
#define ONE_ONLY_READONLY_DATA_SECTION_ASM_OP "\t.SPACE $TEXT$\n\
\t.NSUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16,COMDAT\n"
/* Output before writable data. */
#define DATA_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\t.SUBSPA $DATA$\n" #define DATA_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\t.SUBSPA $DATA$\n"
/* Output before one-only data. We make data one only by creating /* String to output before uninitialized data. */
a new $DATA$ subspace in $PRIVATE$ with the comdat flag. */
#define ONE_ONLY_DATA_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\
\t.NSUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31,SORT=24,COMDAT\n"
/* Output before uninitialized data. */
#define BSS_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\t.SUBSPA $BSS$\n" #define BSS_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\t.SUBSPA $BSS$\n"
#define EXTRA_SECTIONS \
in_readonly_data, \
in_one_only_readonly_data, \
in_one_only_data
#define EXTRA_SECTION_FUNCTIONS \
READONLY_DATA_FUNCTION \
ONE_ONLY_READONLY_DATA_SECTION_FUNCTION \
ONE_ONLY_DATA_SECTION_FUNCTION \
FORGET_SECTION_FUNCTION
#define READONLY_DATA_FUNCTION \
void \
readonly_data (void) \
{ \
if (in_section != in_readonly_data) \
{ \
in_section = in_readonly_data; \
fputs (READONLY_DATA_ASM_OP, asm_out_file); \
} \
} \
#define ONE_ONLY_READONLY_DATA_SECTION_FUNCTION \
void \
one_only_readonly_data_section (void) \
{ \
in_section = in_one_only_readonly_data; \
fputs (ONE_ONLY_READONLY_DATA_SECTION_ASM_OP, asm_out_file); \
} \
#define ONE_ONLY_DATA_SECTION_FUNCTION \
void \
one_only_data_section (void) \
{ \
in_section = in_one_only_data; \
fputs (ONE_ONLY_DATA_SECTION_ASM_OP, asm_out_file); \
}
#define FORGET_SECTION_FUNCTION \
void \
forget_section (void) \
{ \
in_section = no_section; \
} \
/* FIXME: HPUX ld generates incorrect GOT entries for "T" fixups /* FIXME: HPUX ld generates incorrect GOT entries for "T" fixups
which reference data within the $TEXT$ space (for example constant which reference data within the $TEXT$ space (for example constant
strings in the $LIT$ subspace). strings in the $LIT$ subspace).
...@@ -296,7 +227,8 @@ forget_section (void) \ ...@@ -296,7 +227,8 @@ forget_section (void) \
$TEXT$ space during PIC generation. Instead place all constant $TEXT$ space during PIC generation. Instead place all constant
data into the $PRIVATE$ subspace (this reduces sharing, but it data into the $PRIVATE$ subspace (this reduces sharing, but it
works correctly). */ works correctly). */
#define READONLY_DATA_SECTION (flag_pic ? data_section : readonly_data) #define READONLY_DATA_SECTION \
(flag_pic ? data_section : som_readonly_data_section)
/* We must not have a reference to an external symbol defined in a /* We must not have a reference to an external symbol defined in a
shared library in a readonly section, else the SOM linker will shared library in a readonly section, else the SOM linker will
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment