add -fvisibility=hidden to CC flags, mark XXX_main functions

EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
This commit is contained in:
Denis Vlasenko
2007-10-11 10:05:36 +00:00
parent 8d82cf72c9
commit 9b49a5ed85
260 changed files with 325 additions and 307 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
#include "libbb.h"
int free_main(int argc, char **argv);
int free_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int free_main(int argc, char **argv)
{
struct sysinfo info;
+1 -1
View File
@@ -316,7 +316,7 @@ static int fuser_kill_pid_list(pid_list *plist, int sig)
return success;
}
int fuser_main(int argc, char **argv);
int fuser_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int fuser_main(int argc, char **argv)
{
/*static -- huh???*/ int opt = 0; /* FUSER_OPT_ */
+1 -1
View File
@@ -24,7 +24,7 @@
* This is needed to avoid collision with kill -9 ... syntax
*/
int kill_main(int argc, char **argv);
int kill_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int kill_main(int argc, char **argv)
{
char *arg;
+1 -1
View File
@@ -770,7 +770,7 @@ static init_func *const init_functions[] = {
init_cr
};
int nmeter_main(int argc, char **argv);
int nmeter_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int nmeter_main(int argc, char **argv)
{
char buf[32];
+1 -1
View File
@@ -44,7 +44,7 @@ static void act(unsigned pid, char *cmd, int signo, unsigned opt)
kill(pid, signo);
}
int pgrep_main(int argc, char **argv);
int pgrep_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int pgrep_main(int argc, char **argv)
{
unsigned pid = getpid();
+1 -1
View File
@@ -16,7 +16,7 @@ enum {
OPT_OMIT = USE_FEATURE_PIDOF_OMIT( (1<<OPTBIT_OMIT )) + 0,
};
int pidof_main(int argc, char **argv);
int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int pidof_main(int argc, char **argv)
{
unsigned first = 1;
+2 -2
View File
@@ -278,7 +278,7 @@ static void format_process(const procps_status_t *ps)
printf("%.*s\n", terminal_width, buffer);
}
int ps_main(int argc, char **argv);
int ps_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ps_main(int argc, char **argv)
{
procps_status_t *p;
@@ -340,7 +340,7 @@ int ps_main(int argc, char **argv)
#else /* !ENABLE_DESKTOP */
int ps_main(int argc, char **argv);
int ps_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ps_main(int argc, char **argv)
{
procps_status_t *p = NULL;
+1 -1
View File
@@ -26,7 +26,7 @@ void BUG_bad_PRIO_PROCESS(void);
void BUG_bad_PRIO_PGRP(void);
void BUG_bad_PRIO_USER(void);
int renice_main(int argc, char **argv);
int renice_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int renice_main(int argc, char **argv)
{
static const char Xetpriority_msg[] ALIGN1 = "%cetpriority";
+1 -1
View File
@@ -59,7 +59,7 @@ static void dwrite_str(int fd, const char *buf)
/*
* sysctl_main()...
*/
int sysctl_main(int argc, char **argv);
int sysctl_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int sysctl_main(int argc, char **argv)
{
int retval = 0;
+1 -1
View File
@@ -782,7 +782,7 @@ enum {
| PSSCAN_COMM,
};
int top_main(int argc, char **argv);
int top_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int top_main(int argc, char **argv)
{
int count, lines, col;
+1 -1
View File
@@ -25,7 +25,7 @@
#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
int uptime_main(int argc, char **argv);
int uptime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int uptime_main(int argc, char **argv)
{
int updays, uphours, upminutes;
+1 -1
View File
@@ -23,7 +23,7 @@
//
// (procps 3.x and procps 2.x are forks, not newer/older versions of the same)
int watch_main(int argc, char **argv);
int watch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int watch_main(int argc, char **argv)
{
unsigned opt;