add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
diff --git a/archival/ar.c b/archival/ar.c
index cbe4d8e..0a95e5c 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -37,7 +37,7 @@
#define AR_OPT_CREATE 0x20
#define AR_OPT_INSERT 0x40
-int ar_main(int argc, char **argv);
+int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int ar_main(int argc, char **argv)
{
static const char msg_unsupported_err[] ALIGN1 =
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index e106bf0..61b5e39 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -158,7 +158,7 @@
return unpack_bz2_stream(STDIN_FILENO, STDOUT_FILENO);
}
-int bunzip2_main(int argc, char **argv);
+int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int bunzip2_main(int argc, char **argv)
{
getopt32(argv, "cf");
@@ -256,7 +256,7 @@
return status;
}
-int gunzip_main(int argc, char **argv);
+int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int gunzip_main(int argc, char **argv)
{
getopt32(argv, "cfvdt");
@@ -294,7 +294,7 @@
return unpack_lzma_stream(STDIN_FILENO, STDOUT_FILENO);
}
-int unlzma_main(int argc, char **argv);
+int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int unlzma_main(int argc, char **argv)
{
getopt32(argv, "cf");
@@ -336,7 +336,7 @@
return status;
}
-int uncompress_main(int argc, char **argv);
+int uncompress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int uncompress_main(int argc, char **argv)
{
getopt32(argv, "cf");
diff --git a/archival/cpio.c b/archival/cpio.c
index 9188e09..59ae60c 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -22,7 +22,7 @@
#define CPIO_OPT_CREATE_LEADING_DIR 0x20
#define CPIO_OPT_PRESERVE_MTIME 0x40
-int cpio_main(int argc, char **argv);
+int cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int cpio_main(int argc, char **argv)
{
archive_handle_t *archive_handle;
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 337576c..27512eb 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1557,7 +1557,7 @@
set_status(status_num, "installed", 3);
}
-int dpkg_main(int argc, char **argv);
+int dpkg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int dpkg_main(int argc, char **argv)
{
deb_file_t **deb_file = NULL;
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index 9781b54..e1d2cd0 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -13,7 +13,7 @@
#define DPKG_DEB_OPT_EXTRACT 8
#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
-int dpkg_deb_main(int argc, char **argv);
+int dpkg_deb_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int dpkg_deb_main(int argc, char **argv)
{
archive_handle_t *ar_archive;
diff --git a/archival/gzip.c b/archival/gzip.c
index cabcc5e..bc7502e 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -2025,7 +2025,7 @@
return 0;
}
-int gzip_main(int argc, char **argv);
+int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int gzip_main(int argc, char **argv)
{
unsigned opt;
diff --git a/archival/rpm.c b/archival/rpm.c
index 0b7741a..f078aea 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -80,7 +80,7 @@
static void fileaction_setowngrp(char *filename, int fileref);
static void loop_through_files(int filetag, void (*fileaction)(char *filename, int fileref));
-int rpm_main(int argc, char **argv);
+int rpm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int rpm_main(int argc, char **argv)
{
int opt = 0, func = 0, rpm_fd, offset;
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c
index fe71e98..329f8f7 100644
--- a/archival/rpm2cpio.c
+++ b/archival/rpm2cpio.c
@@ -49,7 +49,7 @@
}
/* No getopt required */
-int rpm2cpio_main(int argc, char **argv);
+int rpm2cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int rpm2cpio_main(int argc, char **argv)
{
struct rpm_lead lead;
diff --git a/archival/tar.c b/archival/tar.c
index 18b6267..3fe1886 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -769,7 +769,7 @@
;
#endif
-int tar_main(int argc, char **argv);
+int tar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int tar_main(int argc, char **argv)
{
char (*get_header_ptr)(archive_handle_t *) = get_header_tar;
diff --git a/archival/unzip.c b/archival/unzip.c
index 21d4c25..bd113af 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -93,7 +93,7 @@
return 0;
}
-int unzip_main(int argc, char **argv);
+int unzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int unzip_main(int argc, char **argv)
{
zip_header_t zip_header;