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
96f158f7
Commit
96f158f7
authored
Jan 16, 1996
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ASM_OUTPUT_SECTION_NAME): Define section attributes only when a
section is defined the first time. From-SVN: r11014
parent
5aee39a5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
9 deletions
+55
-9
gcc/config/svr4.h
+55
-9
No files found.
gcc/config/svr4.h
View file @
96f158f7
/* Operating system specific defines to be used when targeting GCC for some
/* Operating system specific defines to be used when targeting GCC for some
generic System V Release 4 system.
generic System V Release 4 system.
Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1991, 1994, 1995
, 1996
Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@segfault.us.com).
Contributed by Ron Guilmette (rfg@segfault.us.com).
This file is part of GNU CC.
This file is part of GNU CC.
...
@@ -592,16 +592,62 @@ dtors_section () \
...
@@ -592,16 +592,62 @@ dtors_section () \
} \
} \
}
}
/* Switch into a generic section.
This is currently only used to support section attributes.
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. */
* 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) \
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \
do { \
(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \
static struct section_info \
(DECL) && TREE_READONLY (DECL) ? "a" : "aw")
{ \
struct section_info *next; \
char *name; \
enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
} *sections; \
struct section_info *s; \
char *mode; \
enum sect_enum type; \
\
for (s = sections; s; s = s->next) \
if (!strcmp (NAME, s->name)) \
break; \
\
if (DECL) \
{ \
if (TREE_CODE (DECL) == FUNCTION_DECL) \
type = SECT_EXEC, mode = "ax"; \
else if (TREE_READONLY(DECL)) \
type = SECT_RO, mode = "a"; \
else \
type = SECT_RW, mode = "aw"; \
} \
\
if (s == 0 && DECL) \
{ \
s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
strcpy (s->name, NAME); \
s->type = type; \
s->next = sections; \
sections = s; \
fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, mode); \
} \
else \
{ \
if (DECL && s->type != type) \
error_with_decl (DECL, "%s causes a section type conflict"); \
\
fprintf (FILE, ".section\t%s\n", NAME); \
} \
} while (0)
/* A C statement (sans semicolon) to output an element in the table of
/* A C statement (sans semicolon) to output an element in the table of
global constructors. */
global constructors. */
...
...
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