Commit b8898790 by Richard Sandiford Committed by Richard Sandiford

elf64.h (TARGET_ASM_UNIQUE_SECTION): Delete.

	* config/mips/elf64.h (TARGET_ASM_UNIQUE_SECTION): Delete.
	(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
	(SECTION_FUNCTION_TEMPLATE): Delete.
	* config/mips/elf.h: As for elf64.h.
	(ASM_OUTPUT_ALIGNED_BSS): Use named_section rather than sbss_section.
	* config/mips/linux.h: As for elf.h
	* config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete.
	* config/mips/iris6.h (EXTRA_SECTIONS): Delete.
	(EXTRA_SECTION_FUNCTIONS): Remove sdata_section.  Remove the handling
	of in_sdata from current_section_name and current_section_flags.
	* config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete.
	* config/mips/mips.h (sdata_section, sbss_section): Remove prototypes.
	(MASK_GP_OPT, TARGET_GP_OPT): Delete.
	(MASK_NO_FUSED_MADD): Use MASK_GP_OPT's old value.
	(TARGET_SWITCHES): Neuter gpOPT, gpopt, no-gpOPT and no-gpopt.
	(SMALL_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove.
	* config/mips/mips.c (TARGET_IN_SMALL_DATA_P): Override.
	(TARGET_SECTION_TYPE_FLAGS): Override if TARGET_IRIX6.
	(mips_classify_symbol): Use SYMBOL_REF_SMALL_P.
	(override_options): Remove setting of MASK_GPOPT.
	(mips_output_external): Use mips_in_small_data_p to check whether a
	symbol needs an .extern directive.  Don't emit such directives for
	TARGET_EXPLICIT_RELOCS.
	(mips_declare_object): Update accordingly.
	(mips_select_rtx_section): Call named_section rather than
	SMALL_DATA_SECTION.
	(mips_select_section): Use default_elf_section_section for everything
	except .text string constants.
	(mips_in_small_data_p): New function.
	(mips_encode_section_info): Remove small data handling.
	(mips_unique_section): Delete.
	(iris6_section_type_flags): New function.
	* doc/tm.texi: Remove documentation of -mgpopt and -mhalf-pic.

From-SVN: r69090
parent c5ffd36c
2003-07-08 Richard Sandiford <rsandifo@redhat.com>
* config/mips/elf64.h (TARGET_ASM_UNIQUE_SECTION): Delete.
(EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete.
(SECTION_FUNCTION_TEMPLATE): Delete.
* config/mips/elf.h: As for elf64.h.
(ASM_OUTPUT_ALIGNED_BSS): Use named_section rather than sbss_section.
* config/mips/linux.h: As for elf.h
* config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete.
* config/mips/iris6.h (EXTRA_SECTIONS): Delete.
(EXTRA_SECTION_FUNCTIONS): Remove sdata_section. Remove the handling
of in_sdata from current_section_name and current_section_flags.
* config/mips/iris6gld.h (TARGET_ASM_UNIQUE_SECTION): Delete.
* config/mips/mips.h (sdata_section, sbss_section): Remove prototypes.
(MASK_GP_OPT, TARGET_GP_OPT): Delete.
(MASK_NO_FUSED_MADD): Use MASK_GP_OPT's old value.
(TARGET_SWITCHES): Neuter gpOPT, gpopt, no-gpOPT and no-gpopt.
(SMALL_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove.
* config/mips/mips.c (TARGET_IN_SMALL_DATA_P): Override.
(TARGET_SECTION_TYPE_FLAGS): Override if TARGET_IRIX6.
(mips_classify_symbol): Use SYMBOL_REF_SMALL_P.
(override_options): Remove setting of MASK_GPOPT.
(mips_output_external): Use mips_in_small_data_p to check whether a
symbol needs an .extern directive. Don't emit such directives for
TARGET_EXPLICIT_RELOCS.
(mips_declare_object): Update accordingly.
(mips_select_rtx_section): Call named_section rather than
SMALL_DATA_SECTION.
(mips_select_section): Use default_elf_section_section for everything
except .text string constants.
(mips_in_small_data_p): New function.
(mips_encode_section_info): Remove small data handling.
(mips_unique_section): Delete.
(iris6_section_type_flags): New function.
* doc/tm.texi: Remove documentation of -mgpopt and -mhalf-pic.
2003-07-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR Target/11453
......
......@@ -94,7 +94,7 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
if (SIZE > 0 && SIZE <= (unsigned HOST_WIDE_INT)mips_section_threshold)\
sbss_section (); \
named_section (0, ".sbss", 0); \
else \
bss_section (); \
ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
......@@ -183,28 +183,6 @@ do { \
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define TARGET_ASM_UNIQUE_SECTION mips_unique_section
/* A list of other sections which the compiler might be "in" at any
given time. */
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_sdata, in_sbss
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP)
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
void FN () \
{ \
if (in_section != ENUM) \
{ \
fprintf (asm_out_file, "%s\n", OP); \
in_section = ENUM; \
} \
}
/* On elf, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
crtstuff.c and other files know this by defining the following symbols.
......
......@@ -142,27 +142,6 @@ do { \
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define TARGET_ASM_UNIQUE_SECTION mips_unique_section
/* A list of other sections which the compiler might be "in" at any
given time. */
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_sdata
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP)
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
void FN () \
{ \
if (in_section != ENUM) \
{ \
fprintf (asm_out_file, "%s\n", OP); \
in_section = ENUM; \
} \
}
/* On elf, we *do* have support for the .init and .fini sections, and we
can put stuff in there to be executed before and after `main'. We let
crtstuff.c and other files know this by defining the following symbols.
......
......@@ -281,30 +281,11 @@ Boston, MA 02111-1307, USA. */
? READONLY_DATA_SECTION_ASM_OP_64 \
: READONLY_DATA_SECTION_ASM_OP_32)
/* A default list of other sections which we might be "in" at any given
time. For targets that use additional sections (e.g. .tdesc) you
should override this definition in the target-specific file which
includes this file. */
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_sdata
/* A default list of extra section function definitions. For targets
that use additional sections (e.g. .tdesc) you should override this
definition in the target-specific file which includes this file. */
/* Define functions to read the name and flags of the current section.
They are used by iris6_asm_output_align. */
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
void \
sdata_section () \
{ \
if (in_section != in_sdata) \
{ \
fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
in_section = in_sdata; \
} \
} \
\
const char * \
current_section_name () \
{ \
......@@ -313,7 +294,6 @@ current_section_name () \
case no_section: return NULL; \
case in_text: return ".text"; \
case in_data: return ".data"; \
case in_sdata: return ".sdata"; \
case in_bss: return ".bss"; \
case in_readonly_data: \
if (mips_abi != ABI_32 && mips_abi != ABI_O64) \
......@@ -334,7 +314,6 @@ current_section_flags () \
case no_section: return 0; \
case in_text: return SECTION_CODE; \
case in_data: return SECTION_WRITE; \
case in_sdata: return SECTION_WRITE | SECTION_SMALL; \
case in_bss: return SECTION_WRITE | SECTION_BSS; \
case in_readonly_data: return 0; \
case in_named: return get_named_section_flags (in_named_name); \
......
......@@ -49,4 +49,3 @@ Boston, MA 02111-1307, USA. */
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define TARGET_ASM_UNIQUE_SECTION mips_unique_section
......@@ -47,7 +47,7 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
do { \
if (SIZE > 0 && (long)(SIZE) <= mips_section_threshold) \
sbss_section (); \
named_section (0, ".sbss", 0); \
else \
bss_section (); \
ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
......@@ -78,28 +78,6 @@ do { \
mips_declare_object (FILE, NAME, "", ":\n", 0); \
} while (0)
#define TARGET_ASM_UNIQUE_SECTION mips_unique_section
/* A list of other sections which the compiler might be "in" at any
given time. */
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_sdata, in_sbss
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
SECTION_FUNCTION_TEMPLATE(sdata_section, in_sdata, SDATA_SECTION_ASM_OP) \
SECTION_FUNCTION_TEMPLATE(sbss_section, in_sbss, SBSS_SECTION_ASM_OP)
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
void FN () \
{ \
if (in_section != ENUM) \
{ \
fprintf (asm_out_file, "%s\n", OP); \
in_section = ENUM; \
} \
}
#undef TARGET_VERSION
#if TARGET_ENDIAN_DEFAULT == 0
#define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/Linux with ELF)");
......
......@@ -148,10 +148,6 @@ extern const struct mips_cpu_info mips_cpu_info_table[];
extern const struct mips_cpu_info *mips_arch_info;
extern const struct mips_cpu_info *mips_tune_info;
/* Functions to change what output section we are using. */
extern void sdata_section PARAMS ((void));
extern void sbss_section PARAMS ((void));
/* Macros to silence warnings about numbers being signed in traditional
C and unsigned in ISO C when compiled on 32-bit hosts. */
......@@ -168,7 +164,8 @@ extern void sbss_section PARAMS ((void));
#define MASK_INT64 0x00000001 /* ints are 64 bits */
#define MASK_LONG64 0x00000002 /* longs are 64 bits */
#define MASK_SPLIT_ADDR 0x00000004 /* Address splitting is enabled. */
#define MASK_GPOPT 0x00000008 /* Optimize for global pointer */
#define MASK_NO_FUSED_MADD 0x00000008 /* Don't generate floating point
multiply-add operations. */
#define MASK_GAS 0x00000010 /* Gas used instead of MIPS as */
#define MASK_NAME_REGS 0x00000020 /* Use MIPS s/w reg name convention */
#define MASK_EXPLICIT_RELOCS 0x00000040 /* Use relocation operators. */
......@@ -193,8 +190,6 @@ extern void sbss_section PARAMS ((void));
#define MASK_UNINIT_CONST_IN_RODATA \
0x00800000 /* Store uninitialized
consts in rodata */
#define MASK_NO_FUSED_MADD 0x01000000 /* Don't generate floating point
multiply-add operations. */
/* Debug switches, not documented */
#define MASK_DEBUG 0 /* unused */
......@@ -237,9 +232,6 @@ extern void sbss_section PARAMS ((void));
/* Reg. Naming in .s ($21 vs. $a0) */
#define TARGET_NAME_REGS (target_flags & MASK_NAME_REGS)
/* Optimize for Sdata/Sbss */
#define TARGET_GP_OPT (target_flags & MASK_GPOPT)
/* call memcpy instead of inline code */
#define TARGET_MEMCPY (target_flags & MASK_MEMCPY)
......@@ -532,14 +524,14 @@ extern void sbss_section PARAMS ((void));
N_("Use symbolic register names")}, \
{"no-rnames", -MASK_NAME_REGS, \
N_("Don't use symbolic register names")}, \
{"gpOPT", MASK_GPOPT, \
N_("Use GP relative sdata/sbss sections")}, \
{"gpopt", MASK_GPOPT, \
N_("Use GP relative sdata/sbss sections")}, \
{"no-gpOPT", -MASK_GPOPT, \
N_("Don't use GP relative sdata/sbss sections")}, \
{"no-gpopt", -MASK_GPOPT, \
N_("Don't use GP relative sdata/sbss sections")}, \
{"gpOPT", 0, \
N_("Use GP relative sdata/sbss sections (now ignored)")}, \
{"gpopt", 0, \
N_("Use GP relative sdata/sbss sections (now ignored)")}, \
{"no-gpOPT", 0, \
N_("Don't use GP relative sdata/sbss sections (now ignored)")}, \
{"no-gpopt", 0, \
N_("Don't use GP relative sdata/sbss sections (now ignored)")}, \
{"stats", 0, \
N_("Output compiler statistics (now ignored)")}, \
{"no-stats", 0, \
......@@ -3863,35 +3855,6 @@ do { \
#undef READONLY_DATA_SECTION_ASM_OP
#define READONLY_DATA_SECTION_ASM_OP "\t.rdata" /* read-only data */
#define SMALL_DATA_SECTION sdata_section
/* What other sections we support other than the normal .data/.text. */
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_sdata
/* Define the additional functions to select our additional sections. */
/* on the MIPS it is not a good idea to put constants in the text
section, since this defeats the sdata/data mechanism. This is
especially true when -O is used. In this case an effort is made to
address with faster (gp) register relative addressing, which can
only get at sdata and sbss items (there is no stext !!) However,
if the constant is too large for sdata, and it's readonly, it
will go into the .rdata section. */
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
void \
sdata_section () \
{ \
if (in_section != in_sdata) \
{ \
fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \
in_section = in_sdata; \
} \
}
/* Given a decl node or constant node, choose the section to output it in
and select that section. */
......
......@@ -465,14 +465,13 @@ in the following sections.
@gccoptlist{-mabicalls -march=@var{cpu-type} -mtune=@var{cpu=type} @gol
-mcpu=@var{cpu-type} -membedded-data -muninit-const-in-rodata @gol
-membedded-pic -mfp32 -mfp64 -mfused-madd -mno-fused-madd @gol
-mgas -mgp32 -mgp64 @gol
-mgpopt -mhalf-pic -mhard-float -mint64 -mips1 @gol
-mgas -mgp32 -mgp64 -mhard-float -mint64 -mips1 @gol
-mips2 -mips3 -mips4 -mips32 -mips32r2 -mips64 @gol
-mlong64 -mlong32 -mlong-calls -mmemcpy @gol
-mmips-as -mmips-tfile -mno-abicalls @gol
-mno-embedded-data -mno-uninit-const-in-rodata @gol
-mno-embedded-pic -mno-gpopt -mno-long-calls @gol
-mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats @gol
-mno-embedded-pic -mno-long-calls @gol
-mno-memcpy -mno-mips-tfile -mno-rnames @gol
-mrnames -msoft-float @gol
-m4650 -msingle-float -mmad @gol
-EL -EB -G @var{num} -nocpp @gol
......@@ -7962,16 +7961,6 @@ names for the registers, instead of the hardware names (ie, @var{a0}
instead of @var{$4}). The only known assembler that supports this option
is the Algorithmics assembler.
@item -mgpopt
@itemx -mno-gpopt
@opindex mgpopt
@opindex mno-gpopt
The @option{-mgpopt} switch says to write all of the data declarations
before the instructions in the text section, this allows the MIPS
assembler to generate one word memory references instead of using two
words for short global or static data items. This is on by default if
optimization is selected.
@item -mmemcpy
@itemx -mno-memcpy
@opindex mmemcpy
......@@ -8026,13 +8015,6 @@ loading up a function's address into a register before the call.
You need to use this switch, if you call outside of the current
512 megabyte segment to functions that are not through pointers.
@item -mhalf-pic
@itemx -mno-half-pic
@opindex mhalf-pic
@opindex mno-half-pic
Put pointers to extern references into the data section and load them
up, rather than put the references in the text section.
@item -membedded-pic
@itemx -mno-embedded-pic
@opindex membedded-pic
......
2003-07-08 Richard Sandiford <rsandifo@redhat.com>
* gcc.dg/compat/sdata-section.h: New file.
* gcc.dg/compat/sdata-1_{x,y,main}.c: New test.
* gcc.dg/torture/mips-sdata-1.c: New test.
2003-07-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/11030
......
/* Check that sdata qualification doesn't produce out-of-range relocations
and that compilers agree on the way these declarations are handled. */
extern void sdata_1_x (void);
extern void exit (int);
int
main ()
{
sdata_1_x ();
exit (0);
}
#include "sdata-section.h"
struct s { int x; int y[4]; };
extern struct s small_struct SDATA_SECTION;
/* Test "load address" operations. */
int *xaddr (void) { return &small_struct.x; }
int *yaddr (int i) { return &small_struct.y[i]; }
void sdata_1_x (void)
{
int i;
/* Test direct accesses. */
small_struct.x = 5;
for (i = 0; i < 4; i++)
small_struct.y[i] = i + 42;
if (*xaddr () != 5)
abort ();
for (i = 0; i < 4; i++)
if (*yaddr (i) != i + 42)
abort ();
}
#include "sdata-section.h"
struct s { int x; int y[4]; };
struct s small_struct SDATA_SECTION;
#ifdef __mips
#define SDATA_SECTION __attribute__((__section__(".sdata")))
#else
#define SDATA_SECTION
#endif
/* Check that sdata-accesses are applied regardless of size or ABI. */
/* { dg-options -mexplicit-relocs } */
/* { dg-do compile { target mips*-*-* } } */
struct s { int x[4]; };
struct s my_struct __attribute__((__section__(".sdata")));
int f() { return my_struct.x[3]; }
/* { dg-final { scan-assembler {gp_?rel\(my_struct} } } */
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