Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
ad4ff310
Commit
ad4ff310
authored
Apr 30, 1997
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
From-SVN: r13994
parent
a4b3b54a
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
114 additions
and
100 deletions
+114
-100
gcc/config/a29k/a29k.h
+1
-1
gcc/config/alpha/elf.h
+2
-2
gcc/config/arm/coff.h
+2
-2
gcc/config/h8300/h8300.h
+1
-1
gcc/config/i386/cygwin32.h
+6
-11
gcc/config/i386/go32.h
+1
-6
gcc/config/i386/sco5.h
+3
-3
gcc/config/i386/winnt.c
+3
-2
gcc/config/m68k/coff.h
+2
-2
gcc/config/mips/elf64.h
+2
-2
gcc/config/mips/iris6.h
+2
-2
gcc/config/mips/netbsd.h
+2
-2
gcc/config/pa/pa.h
+2
-2
gcc/config/psos.h
+2
-2
gcc/config/ptx4.h
+2
-2
gcc/config/rs6000/sysv4.h
+2
-2
gcc/config/sh/sh.h
+1
-1
gcc/config/sparc/sysv4.h
+2
-2
gcc/config/svr4.h
+20
-26
gcc/output.h
+14
-2
gcc/varasm.c
+42
-25
No files found.
gcc/config/a29k/a29k.h
View file @
ad4ff310
...
...
@@ -1450,7 +1450,7 @@ extern int a29k_debug_reg_map[];
/* This how to write an assembler directive to FILE to switch to
section NAME for DECL. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
fprintf (FILE, "\t.sect %s, bss\n\t.use %s\n", NAME, NAME)
/* This is how to output the definition of a user-level label named NAME,
...
...
gcc/config/alpha/elf.h
View file @
ad4ff310
...
...
@@ -276,10 +276,10 @@ dtors_section () \
We make the section read-only and executable for a function decl,
read-only for a const data decl, and writable for a non-const data decl. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
(DECL) &&
TREE_READONLY (DECL
) ? "a" : "aw")
(DECL) &&
DECL_READONLY_SECTION (DECL, RELOC
) ? "a" : "aw")
/* A C statement (sans semicolon) to output an element in the table of
...
...
gcc/config/arm/coff.h
View file @
ad4ff310
...
...
@@ -87,11 +87,11 @@ do { \
NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME
, RELOC
) \
do { \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
fprintf (STREAM, "\t.section %s,\"x\"\n", (NAME)); \
else if ((DECL) &&
TREE_READONLY (DECL))
\
else if ((DECL) &&
DECL_READONLY_SECTION (DECL, RELOC))
\
fprintf (STREAM, "\t.section %s,\"\"\n", (NAME)); \
else \
fprintf (STREAM, "\t.section %s,\"w\"\n", (NAME)); \
...
...
gcc/config/h8300/h8300.h
View file @
ad4ff310
...
...
@@ -1182,7 +1182,7 @@ readonly_data() \
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
fprintf (FILE, "\t.section %s\n", NAME)
/* This is how to output the definition of a user-level label named NAME,
...
...
gcc/config/i386/cygwin32.h
View file @
ad4ff310
...
...
@@ -172,27 +172,22 @@ while (0)
symbols must be explicitly imported from shared libraries (DLLs). */
#define MULTIPLE_SYMBOL_SPACES
/* For objects going into their own sections, a C expression of name of the
section, expressed as a STRING_CST node, to put DECL into. The
STRING_CST node must be allocated in the saveable obstack. Function
build_string can be used to do this. Define this macro if the name of a
symbol cannot be used as its section name. */
extern
union
tree_node
*
i386_pe_unique_section
();
#define UNIQUE_SECTION(DECL) i386_pe_unique_section (DECL)
#define UNIQUE_SECTION_P(DECL) DECL_ONE_ONLY (DECL)
extern
void
i386_pe_unique_section
();
#define UNIQUE_SECTION(DECL,RELOC) i386_pe_unique_section (DECL, RELOC)
#define MAKE_DECL_ONE_ONLY(DECL) \
DECL_SECTION_NAME (DECL) = UNIQUE_SECTION (DECL)
#define SUPPORTS_ONE_ONLY 1
/* A C statement to output something to the assembler file to switch to section
NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
#undef ASM_OUTPUT_SECTION_NAME
#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME
)
\
#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME
, RELOC)
\
do { \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
fprintf (STREAM, "\t.section %s,\"x\"\n", (NAME)); \
else if ((DECL) &&
TREE_READONLY (DECL))
\
else if ((DECL) &&
DECL_READONLY_SECTION (DECL, RELOC))
\
fprintf (STREAM, "\t.section %s,\"\"\n", (NAME)); \
else \
fprintf (STREAM, "\t.section %s,\"w\"\n", (NAME)); \
...
...
gcc/config/i386/go32.h
View file @
ad4ff310
...
...
@@ -58,7 +58,7 @@ dtor_section () \
} while (0)
/* Allow (eg) __attribute__((section "locked")) to work */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME)\
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
)\
do { \
fprintf (FILE, "\t.section %s\n", NAME); \
} while (0)
...
...
@@ -81,11 +81,6 @@ dtor_section () \
output_file_directive (FILE, main_input_filename); \
} while (0)
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME)\
do { \
fprintf (FILE, "\t.section %s\n", NAME); \
} while (0)
/* This is how to output an assembler line
that says to advance the location counter
to a multiple of 2**LOG bytes. */
...
...
gcc/config/i386/sco5.h
View file @
ad4ff310
...
...
@@ -477,18 +477,18 @@ do { \
#define USER_LABEL_PREFIX ""
#undef ASM_OUTPUT_SECTION_NAME
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
do { \
char *snam = NAME ; \
if (strcmp(NAME, ".gcc_except_table") == 0) snam = ".gccexc" ; \
if (TARGET_ELF) \
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
(DECL) &&
TREE_READONLY (DECL) ? "a" : "aw");
\
(DECL) &&
DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw");
\
else \
fprintf (FILE, ".section\t%s,\"%s\"\n", snam, \
(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "x" : \
(DECL) &&
TREE_READONLY (DECL) ? "a" : "w");
\
(DECL) &&
DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "w");
\
} while (0)
#undef ASM_OUTPUT_SKIP
...
...
gcc/config/i386/winnt.c
View file @
ad4ff310
...
...
@@ -67,8 +67,9 @@ gen_stdcall_suffix (decl)
/* Cover function for UNIQUE_SECTION. */
tree
i386_pe_unique_section
(
decl
)
i386_pe_unique_section
(
decl
,
reloc
)
tree
decl
;
int
reloc
;
{
int
len
;
char
*
name
,
*
string
,
*
prefix
;
...
...
@@ -80,7 +81,7 @@ i386_pe_unique_section (decl)
(everything from the $ on is stripped). */
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
)
prefix
=
".text$"
;
else
if
(
TREE_READONLY
(
decl
))
else
if
(
DECL_READONLY_SECTION
(
decl
,
reloc
))
prefix
=
".rdata$"
;
else
prefix
=
".data$"
;
...
...
gcc/config/m68k/coff.h
View file @
ad4ff310
...
...
@@ -103,10 +103,10 @@ Boston, MA 02111-1307, USA. */
/* Support generic sections */
#undef ASM_OUTPUT_SECTION_NAME
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
fprintf((FILE), ".section\t%s,\"%c\"\n", (NAME), \
(DECL) && (TREE_CODE (DECL) == FUNCTION_DECL || \
TREE_READONLY (DECL
)) ? 'x' : 'd')
DECL_READONLY_SECTION (DECL, RELOC
)) ? 'x' : 'd')
/* Support the ctors and dtors sections for g++. */
...
...
gcc/config/mips/elf64.h
View file @
ad4ff310
...
...
@@ -83,12 +83,12 @@ do { \
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME
, RELOC
) \
do { \
extern FILE *asm_out_text_file; \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
else if ((DECL) &&
TREE_READONLY (DECL))
\
else if ((DECL) &&
DECL_READONLY_SECTION (DECL, RELOC))
\
fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME)); \
else \
fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME)); \
...
...
gcc/config/mips/iris6.h
View file @
ad4ff310
...
...
@@ -338,12 +338,12 @@ dtors_section () \
NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
NULL_TREE. */
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME
)
\
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME
, RELOC)
\
do { \
extern FILE *asm_out_text_file; \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
fprintf (asm_out_text_file, "\t.section %s,1,6,4,4\n", (NAME)); \
else if ((DECL) &&
TREE_READONLY (DECL))
\
else if ((DECL) &&
DECL_READONLY_SECTION (DECL, RELOC))
\
fprintf (F, "\t.section %s,1,2,0,8\n", (NAME)); \
else \
fprintf (F, "\t.section %s,1,3,0,8\n", (NAME)); \
...
...
gcc/config/mips/netbsd.h
View file @
ad4ff310
...
...
@@ -211,12 +211,12 @@ do { \
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases.
*/
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME
)
\
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME
, RELOC)
\
do { \
extern FILE *asm_out_text_file; \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
else if ((DECL) &&
TREE_READONLY (DECL))
\
else if ((DECL) &&
DECL_READONLY_SECTION (DECL, RELOC))
\
fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME)); \
else \
fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME)); \
...
...
gcc/config/pa/pa.h
View file @
ad4ff310
...
...
@@ -1976,7 +1976,7 @@ do { fputs ("\t.SPACE $PRIVATE$\n\
We make the section read-only and executable for a function decl,
read-only for a const data decl, and writable for a non-const data decl. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
{ \
fputs ("\t.SPACE $TEXT$\n", FILE); \
...
...
@@ -1984,7 +1984,7 @@ do { fputs ("\t.SPACE $PRIVATE$\n\
"\t.SUBSPA %s%s%s,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY,SORT=24\n",\
TARGET_GAS ? "" : "$", NAME, TARGET_GAS ? "" : "$"); \
} \
else if (DECL &&
TREE_READONLY (DECL))
\
else if (DECL &&
DECL_READONLY_SECTION (DECL, RELOC))
\
{ \
fputs ("\t.SPACE $TEXT$\n", FILE); \
fprintf (FILE, \
...
...
gcc/config/psos.h
View file @
ad4ff310
...
...
@@ -87,10 +87,10 @@ while (0)
/* Switch into a generic section. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
(DECL) &&
TREE_READONLY (DECL
) ? "a" : "aw")
(DECL) &&
DECL_READONLY_SECTION (DECL, RELOC
) ? "a" : "aw")
/* Define the pseudo-ops used to switch to the .ctors and .dtors
...
...
gcc/config/ptx4.h
View file @
ad4ff310
...
...
@@ -541,10 +541,10 @@ dtors_section () \
We make the section read-only and executable for a function decl,
read-only for a const data decl, and writable for a non-const data decl. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
(DECL) &&
TREE_READONLY (DECL
) ? "a" : "aw")
(DECL) &&
DECL_READONLY_SECTION (DECL, RELOC
) ? "a" : "aw")
/* A C statement (sans semicolon) to output an element in the table of
...
...
gcc/config/rs6000/sysv4.h
View file @
ad4ff310
...
...
@@ -865,7 +865,7 @@ do { \
*/
#undef ASM_OUTPUT_SECTION_NAME
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
)
\
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC)
\
do { \
static struct section_info \
{ \
...
...
@@ -883,7 +883,7 @@ do { \
\
if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
type = SECT_EXEC, mode = "ax"; \
else if (DECL &&
TREE_READONLY (DECL
) && !TARGET_RELOCATABLE && !flag_pic) \
else if (DECL &&
DECL_READONLY_SECTION (DECL, RELOC
) && !TARGET_RELOCATABLE && !flag_pic) \
type = SECT_RO, mode = "a"; \
else \
type = SECT_RW, mode = "aw"; \
...
...
gcc/config/sh/sh.h
View file @
ad4ff310
...
...
@@ -1373,7 +1373,7 @@ dtors_section() \
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
do { fprintf (FILE, ".section\t%s\n", NAME); } while (0)
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
...
...
gcc/config/sparc/sysv4.h
View file @
ad4ff310
...
...
@@ -186,12 +186,12 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \
define this macro in such cases. */
#undef ASM_OUTPUT_SECTION_NAME
/* Override svr4.h's definition. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME
, RELOC
) \
do { \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
fprintf (FILE, ".section\t\"%s%s\",#alloc,#execinstr\n", \
flag_function_sections ? ".text%" : "", (NAME)); \
else if ((DECL) &&
TREE_READONLY (DECL))
\
else if ((DECL) &&
DECL_READONLY_SECTION (DECL, RELOC))
\
fprintf (FILE, ".section\t\"%s\",#alloc\n", (NAME)); \
else \
fprintf (FILE, ".section\t\"%s\",#alloc,#write\n", (NAME)); \
...
...
gcc/config/svr4.h
View file @
ad4ff310
...
...
@@ -593,19 +593,17 @@ dtors_section () \
} \
}
/*
* Switch into a generic section.
*
* We make the section read-only and executable for a function decl,
* read-only for a const data decl, and writable for a non-const data decl.
*
* If the section has already been defined, we must not
* emit the attributes here. The SVR4 assembler does not
* recognize section redefinitions.
* If DECL is NULL, no attributes are emitted.
*/
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
/* Switch into a generic section.
We make the section read-only and executable for a function decl,
read-only for a const data decl, and writable for a non-const data decl.
If the section has already been defined, we must not
emit the attributes here. The SVR4 assembler does not
recognize section redefinitions.
If DECL is NULL, no attributes are emitted. */
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
do { \
static struct section_info \
{ \
...
...
@@ -623,7 +621,7 @@ do { \
\
if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
type = SECT_EXEC, mode = "ax"; \
else if (DECL &&
TREE_READONLY (DECL))
\
else if (DECL &&
DECL_READONLY_SECTION (DECL, RELOC))
\
type = SECT_RO, mode = "a"; \
else \
type = SECT_RW, mode = "aw"; \
...
...
@@ -647,21 +645,20 @@ do { \
} \
} while (0)
/* A C statement (sans semicolon) to mark DECL to be emitted as a
public symbol such that extra copies in multiple translation units will
be discarded by the linker. */
#define MAKE_DECL_ONE_ONLY(DECL) \
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
#define UNIQUE_SECTION(DECL,RELOC) \
do { \
int len; \
char *name, *string, *prefix; \
\
DECL_WEAK (DECL) = 1; \
\
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
\
if (TREE_CODE (DECL) == FUNCTION_DECL) \
if (! DECL_ONE_ONLY (DECL)) \
prefix = "."; \
else if (TREE_CODE (DECL) == FUNCTION_DECL) \
prefix = ".gnu.linkonce.t."; \
else if (
TREE_READONLY (DECL))
\
else if (
DECL_READONLY_SECTION (DECL, RELOC))
\
prefix = ".gnu.linkonce.r."; \
else \
prefix = ".gnu.linkonce.d."; \
...
...
@@ -711,10 +708,7 @@ do { \
} \
else if (TREE_CODE (DECL) == VAR_DECL) \
{ \
if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
|| !DECL_INITIAL (DECL) \
|| (DECL_INITIAL (DECL) != error_mark_node \
&& !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
if (! DECL_READONLY_SECTION (DECL, RELOC)) \
data_section (); \
else \
const_section (); \
...
...
gcc/output.h
View file @
ad4ff310
...
...
@@ -134,8 +134,9 @@ extern int in_text_section PROTO((void));
#ifdef TREE_CODE
/* Tell assembler to change to section NAME for DECL.
If DECL is NULL, just switch to section NAME.
If NAME is NULL, get the name from DECL. */
extern
void
named_section
PROTO
((
tree
,
char
*
));
If NAME is NULL, get the name from DECL.
If RELOC is 1, the initializer for DECL contains relocs. */
extern
void
named_section
PROTO
((
tree
,
char
*
,
int
));
/* Tell assembler to switch to the section for function DECL. */
extern
void
function_section
PROTO
((
tree
));
...
...
@@ -429,3 +430,14 @@ extern int sdb_begin_function_line;
#ifdef BUFSIZ
extern
FILE
*
asm_out_file
;
#endif
/* Decide whether DECL needs to be in a writable section. RELOC is the same
as for SELECT_SECTION. */
#define DECL_READONLY_SECTION(DECL,RELOC) \
(TREE_READONLY (DECL) \
&& ! TREE_THIS_VOLATILE (DECL) \
&& DECL_INITIAL (DECL) \
&& (DECL_INITIAL (DECL) == error_mark_node \
|| TREE_CONSTANT (DECL_INITIAL (DECL))) \
&& ! (RELOC && (flag_pic || DECL_ONE_ONLY (DECL))))
gcc/varasm.c
View file @
ad4ff310
...
...
@@ -250,12 +250,14 @@ in_data_section ()
/* Tell assembler to change to section NAME for DECL.
If DECL is NULL, just switch to section NAME.
If NAME is NULL, get the name from DECL. */
If NAME is NULL, get the name from DECL.
If RELOC is 1, the initializer for DECL contains relocs. */
void
named_section
(
decl
,
name
)
named_section
(
decl
,
name
,
reloc
)
tree
decl
;
char
*
name
;
int
reloc
;
{
if
(
decl
!=
NULL_TREE
&&
TREE_CODE_CLASS
(
TREE_CODE
(
decl
))
!=
'd'
)
...
...
@@ -270,7 +272,7 @@ named_section (decl, name)
in_section
=
in_named
;
#ifdef ASM_OUTPUT_SECTION_NAME
ASM_OUTPUT_SECTION_NAME
(
asm_out_file
,
decl
,
name
);
ASM_OUTPUT_SECTION_NAME
(
asm_out_file
,
decl
,
name
,
reloc
);
#else
/* Section attributes are not supported if this macro isn't provided -
some host formats don't support them at all. The front-end should
...
...
@@ -280,6 +282,29 @@ named_section (decl, name)
}
}
#ifdef ASM_OUTPUT_SECTION_NAME
#ifndef UNIQUE_SECTION
#define UNIQUE_SECTION(DECL,RELOC) \
do { \
int len; \
char *name, *string; \
\
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
/* Strip off any encoding in name. */
\
STRIP_NAME_ENCODING (name, name); \
\
len = strlen (name) + 1; \
string = alloca (len + 1); \
sprintf (string, ".%s", name); \
\
DECL_SECTION_NAME (DECL) = build_string (len, string); \
} while (0)
#endif
#ifndef UNIQUE_SECTION_P
#define UNIQUE_SECTION_P(DECL) 0
#endif
#endif
#ifdef BSS_SECTION_ASM_OP
/* Tell the assembler to switch to the bss section. */
...
...
@@ -376,7 +401,7 @@ function_section (decl)
{
if
(
decl
!=
NULL_TREE
&&
DECL_SECTION_NAME
(
decl
)
!=
NULL_TREE
)
named_section
(
decl
,
(
char
*
)
0
);
named_section
(
decl
,
(
char
*
)
0
,
0
);
else
text_section
();
}
...
...
@@ -391,7 +416,7 @@ variable_section (decl, reloc)
int
reloc
;
{
if
(
IN_NAMED_SECTION
(
decl
))
named_section
(
decl
,
NULL
);
named_section
(
decl
,
NULL
,
reloc
);
else
{
/* C++ can have const variables that get initialized from constructors,
...
...
@@ -410,12 +435,7 @@ variable_section (decl, reloc)
#ifdef SELECT_SECTION
SELECT_SECTION
(
decl
,
reloc
);
#else
if
(
TREE_READONLY
(
decl
)
&&
!
TREE_THIS_VOLATILE
(
decl
)
&&
DECL_INITIAL
(
decl
)
&&
(
DECL_INITIAL
(
decl
)
==
error_mark_node
||
TREE_CONSTANT
(
DECL_INITIAL
(
decl
)))
&&
!
(
flag_pic
&&
reloc
))
if
(
DECL_READONLY_SECTION
(
decl
,
reloc
))
readonly_data_section
();
else
data_section
();
...
...
@@ -430,7 +450,7 @@ void
exception_section
()
{
#ifdef ASM_OUTPUT_SECTION_NAME
named_section
(
NULL_TREE
,
".gcc_except_table"
);
named_section
(
NULL_TREE
,
".gcc_except_table"
,
0
);
#else
if
(
flag_pic
)
data_section
();
...
...
@@ -938,18 +958,10 @@ assemble_start_function (decl, fnname)
#ifdef ASM_OUTPUT_SECTION_NAME
/* If the function is to be put in its own section and it's not in a section
already, indicate so. */
if
(
flag_function_sections
&&
DECL_SECTION_NAME
(
decl
)
==
NULL_TREE
)
{
#ifdef UNIQUE_SECTION
DECL_SECTION_NAME
(
decl
)
=
UNIQUE_SECTION
(
decl
);
#else
char
*
name
=
IDENTIFIER_POINTER
(
DECL_ASSEMBLER_NAME
(
decl
));
/* Strip off any encoding in name. */
STRIP_NAME_ENCODING
(
name
,
name
);
DECL_SECTION_NAME
(
decl
)
=
build_string
(
strlen
(
name
),
name
);
#endif
}
if
((
flag_function_sections
&&
DECL_SECTION_NAME
(
decl
)
==
NULL_TREE
)
||
UNIQUE_SECTION_P
(
decl
))
UNIQUE_SECTION
(
decl
,
0
);
#endif
function_section
(
decl
);
...
...
@@ -1438,6 +1450,11 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
else
if
(
DECL_INITIAL
(
decl
))
reloc
=
output_addressed_constants
(
DECL_INITIAL
(
decl
));
#ifdef ASM_OUTPUT_SECTION_NAME
if
(
UNIQUE_SECTION_P
(
decl
))
UNIQUE_SECTION
(
decl
,
reloc
);
#endif
/* Switch to the appropriate section. */
variable_section
(
decl
,
reloc
);
...
...
@@ -3050,7 +3067,7 @@ output_constant_def_contents (exp, reloc, labelno)
int
align
;
if
(
IN_NAMED_SECTION
(
exp
))
named_section
(
exp
,
NULL
);
named_section
(
exp
,
NULL
,
reloc
);
else
{
/* First switch to text section, except for writable strings. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment