aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/mini-os/arch/ia64/minios-ia64.lds2
-rw-r--r--extras/mini-os/arch/x86/minios-x86_32.lds2
-rw-r--r--extras/mini-os/arch/x86/minios-x86_64.lds2
-rw-r--r--extras/mini-os/main.c4
4 files changed, 2 insertions, 8 deletions
diff --git a/extras/mini-os/arch/ia64/minios-ia64.lds b/extras/mini-os/arch/ia64/minios-ia64.lds
index 8b54c0f394..2866a4a644 100644
--- a/extras/mini-os/arch/ia64/minios-ia64.lds
+++ b/extras/mini-os/arch/ia64/minios-ia64.lds
@@ -55,7 +55,6 @@ SECTIONS
.ctors : AT(ADDR(.ctors) - (((5<<(61))+0x100000000) - (1 << 20)))
{
__CTOR_LIST__ = .;
- QUAD((__CTOR_END__ - __CTOR_LIST__) / 8 - 2)
*(.ctors)
CONSTRUCTORS
QUAD(0)
@@ -65,7 +64,6 @@ SECTIONS
.dtors : AT(ADDR(.dtors) - (((5<<(61))+0x100000000) - (1 << 20)))
{
__DTOR_LIST__ = .;
- QUAD((__DTOR_END__ - __DTOR_LIST__) / 8 - 2)
*(.dtors)
QUAD(0)
__DTOR_END__ = .;
diff --git a/extras/mini-os/arch/x86/minios-x86_32.lds b/extras/mini-os/arch/x86/minios-x86_32.lds
index 13796db768..f5cabb6a11 100644
--- a/extras/mini-os/arch/x86/minios-x86_32.lds
+++ b/extras/mini-os/arch/x86/minios-x86_32.lds
@@ -30,7 +30,6 @@ SECTIONS
.ctors : {
__CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
*(.ctors)
CONSTRUCTORS
LONG(0)
@@ -39,7 +38,6 @@ SECTIONS
.dtors : {
__DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
*(.dtors)
LONG(0)
__DTOR_END__ = .;
diff --git a/extras/mini-os/arch/x86/minios-x86_64.lds b/extras/mini-os/arch/x86/minios-x86_64.lds
index 6a5c0bb2f9..3da0a9f130 100644
--- a/extras/mini-os/arch/x86/minios-x86_64.lds
+++ b/extras/mini-os/arch/x86/minios-x86_64.lds
@@ -30,7 +30,6 @@ SECTIONS
.ctors : {
__CTOR_LIST__ = .;
- QUAD((__CTOR_END__ - __CTOR_LIST__) / 8 - 2)
*(.ctors)
CONSTRUCTORS
QUAD(0)
@@ -39,7 +38,6 @@ SECTIONS
.dtors : {
__DTOR_LIST__ = .;
- QUAD((__DTOR_END__ - __DTOR_LIST__) / 8 - 2)
*(.dtors)
QUAD(0)
__DTOR_END__ = .;
diff --git a/extras/mini-os/main.c b/extras/mini-os/main.c
index 6b53df5e63..b95b889e16 100644
--- a/extras/mini-os/main.c
+++ b/extras/mini-os/main.c
@@ -153,7 +153,7 @@ static void call_main(void *p)
__libc_init_array();
environ = envp;
- for (i = 1; i <= __CTOR_LIST__[0]; i++)
+ for (i = 0; __CTOR_LIST__[i] != 0; i++)
((void((*)(void)))__CTOR_LIST__[i]) ();
tzset();
@@ -164,7 +164,7 @@ void _exit(int ret)
{
int i;
- for (i = 1; i <= __DTOR_LIST__[0]; i++)
+ for (i = 0; __DTOR_LIST__[i] != 0; i++)
((void((*)(void)))__DTOR_LIST__[i]) ();
close_all_files();
__libc_fini_array();