Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181121145150.15500-1-megous@megous.com>
Date: Wed, 21 Nov 2018 15:51:50 +0100
From: megous@...ous.com
To: musl@...ts.openwall.com
Cc: Ondrej Jirman <megous@...ous.com>
Subject: [RFC PATCH] Fix __libc_start_main prototype in [r]crt1.c to match the caller

From: Ondrej Jirman <megous@...ous.com>

__libc_start_main function is not using the last three arguments.

GCC in LTO mode complains about mismatch.
---
 crt/crt1.c  | 6 +++---
 crt/rcrt1.c | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/crt/crt1.c b/crt/crt1.c
index 7b12665f..81ecf118 100644
--- a/crt/crt1.c
+++ b/crt/crt1.c
@@ -8,12 +8,12 @@
 int main();
 weak void _init();
 weak void _fini();
-_Noreturn int __libc_start_main(int (*)(), int, char **,
-	void (*)(), void(*)(), void(*)());
+_Noreturn
+int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv);
 
 void _start_c(long *p)
 {
 	int argc = p[0];
 	char **argv = (void *)(p+1);
-	__libc_start_main(main, argc, argv, _init, _fini, 0);
+	__libc_start_main(main, argc, argv);
 }
diff --git a/crt/rcrt1.c b/crt/rcrt1.c
index 7bb3322f..52928b3e 100644
--- a/crt/rcrt1.c
+++ b/crt/rcrt1.c
@@ -5,10 +5,11 @@
 int main();
 weak void _init();
 weak void _fini();
-_Noreturn int __libc_start_main(int (*)(), int, char **,
-	void (*)(), void(*)(), void(*)());
+
+_Noreturn
+int __libc_start_main(int (*main)(int,char **,char **), int argc, char **argv);
 
 hidden _Noreturn void __dls2(unsigned char *base, size_t *sp)
 {
-	__libc_start_main(main, *sp, (void *)(sp+1), _init, _fini, 0);
+	__libc_start_main(main, *sp, (void *)(sp+1));
 }
-- 
2.19.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.