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

View File

@@ -15,7 +15,7 @@ enum {
VT_WAITACTIVE = 0x5607 /* wait for vt active */
};
int chvt_main(int argc, char **argv);
int chvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int chvt_main(int argc, char **argv)
{
int fd, num;

View File

@@ -12,7 +12,7 @@
#include "libbb.h"
int clear_main(int argc, char **argv);
int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int clear_main(int argc, char **argv)
{
return printf("\033[H\033[J") != 6;

View File

@@ -15,7 +15,7 @@
/* From <linux/vt.h> */
enum { VT_DISALLOCATE = 0x5608 }; /* free memory associated to vt */
int deallocvt_main(int argc, char **argv);
int deallocvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int deallocvt_main(int argc, char **argv)
{
/* num = 0 deallocate all unused consoles */

View File

@@ -22,7 +22,7 @@ struct kbentry {
#define NR_KEYS 128
#define MAX_NR_KEYMAPS 256
int dumpkmap_main(int argc, char **argv);
int dumpkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int dumpkmap_main(int argc, char **argv)
{
struct kbentry ke;

View File

@@ -166,7 +166,7 @@ static void loadnewfont(int fd)
do_loadfont(fd, inbuf + offset, unit, 256);
}
int loadfont_main(int argc, char **argv);
int loadfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int loadfont_main(int argc, char **argv)
{
int fd;

View File

@@ -25,7 +25,7 @@ struct kbentry {
#define NR_KEYS 128
#define MAX_NR_KEYMAPS 256
int loadkmap_main(int argc, char **argv);
int loadkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int loadkmap_main(int argc, char **argv)
{
struct kbentry ke;

View File

@@ -12,7 +12,7 @@
#include "libbb.h"
int openvt_main(int argc, char **argv);
int openvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int openvt_main(int argc, char **argv)
{
char vtname[sizeof(VC_FORMAT) + 2];

View File

@@ -12,7 +12,7 @@
#include "libbb.h"
int reset_main(int argc, char **argv);
int reset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int reset_main(int argc, char **argv)
{
if (isatty(1)) {

View File

@@ -20,7 +20,7 @@ onintr(int sig ATTRIBUTE_UNUSED)
exit(1);
}
int resize_main(int argc, char **argv);
int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int resize_main(int argc, char **argv)
{
struct termios new;

View File

@@ -18,7 +18,7 @@ static const char setconsole_longopts[] ALIGN1 =
#define OPT_SETCONS_RESET 1
int setconsole_main(int argc, char **argv);
int setconsole_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int setconsole_main(int argc, char **argv)
{
unsigned long flags;

View File

@@ -20,8 +20,8 @@ enum {
KDSETKEYCODE = 0x4B4D /* write kernel keycode table entry */
};
int setkeycodes_main(int argc, char** argv);
int setkeycodes_main(int argc, char** argv)
int setkeycodes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int setkeycodes_main(int argc, char **argv)
{
int fd, sc;
struct kbkeycode a;

View File

@@ -11,7 +11,7 @@
#include "libbb.h"
int setlogcons_main(int argc, char **argv);
int setlogcons_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int setlogcons_main(int argc, char **argv)
{
struct {