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
e5952538
Commit
e5952538
authored
Jul 29, 1994
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(DO_GLOBAL_CTORS_BODY): Reverse order of execution
of constuctor lists. From-SVN: r7818
parent
566b213a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
gcc/config/svr3.h
+1
-1
gcc/gbl-ctors.h
+10
-5
No files found.
gcc/config/svr3.h
View file @
e5952538
...
...
@@ -221,7 +221,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
/* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
because they push on the stack. */
#ifdef STACK_GROWS_DOWNWARD
#if
n
def STACK_GROWS_DOWNWARD
/* Constructor list on stack is in reverse order. Go to the end of the
list and go backwards to call constructors in the right order. */
...
...
gcc/gbl-ctors.h
View file @
e5952538
...
...
@@ -63,18 +63,23 @@ extern void __do_global_dtors ();
we define it once here as a macro to avoid various instances getting
out-of-sync with one another. */
/* The first word may or may not contain the number of pointers in the table.
/* Some systems place the number of pointers
in the first word of the table.
On other systems, that word is -1.
In all cases, the table is null-terminated.
We ignore the first word and scan
up to the null. */
If the length is not recorded, count
up to the null. */
/* Some systems use a different strategy for finding the ctors.
For example, svr3. */
#ifndef DO_GLOBAL_CTORS_BODY
#define DO_GLOBAL_CTORS_BODY \
do { \
func_ptr *p; \
for (p = __CTOR_LIST__ + 1; *p; ) \
(*p++) (); \
unsigned nptrs = (unsigned HOST_WIDE_INT) __CTOR_LIST__[0]; \
unsigned i; \
if (nptrs == -1) \
for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++); \
for (i = nptrs; i >= 1; i--) \
__CTOR_LIST__[i] (); \
} while (0)
#endif
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