aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /applets
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
busybox-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2
trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
Diffstat (limited to 'applets')
-rw-r--r--applets/Kbuild4
-rw-r--r--applets/applets.c12
-rwxr-xr-xapplets/usage_compressed2
3 files changed, 9 insertions, 9 deletions
diff --git a/applets/Kbuild b/applets/Kbuild
index e6c5bd506..cf7d29751 100644
--- a/applets/Kbuild
+++ b/applets/Kbuild
@@ -20,6 +20,6 @@ quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h
HOSTCFLAGS_usage.o = -I$(srctree)/include
applets/applets.o: include/usage_compressed.h
-applets/usage: .config
-include/usage_compressed.h: applets/usage
+applets/usage: .config $(srctree)/applets/usage_compressed
+include/usage_compressed.h: applets/usage $(srctree)/applets/usage_compressed
$(call cmd,gen_usage_compressed)
diff --git a/applets/applets.c b/applets/applets.c
index 89dea3e6a..6ff4301e4 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -34,7 +34,7 @@
#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
/* Define usage_messages[] */
-static const char usage_messages[] = ""
+static const char usage_messages[] ALIGN1 = ""
#define MAKE_USAGE
#include "usage.h"
#include "applets.h"
@@ -108,12 +108,12 @@ static char *get_trimmed_slice(char *s, char *e)
}
/* Don't depend on the tools to combine strings. */
-static const char config_file[] = "/etc/busybox.conf";
+static const char config_file[] ALIGN1 = "/etc/busybox.conf";
/* We don't supply a value for the nul, so an index adjustment is
* necessary below. Also, we use unsigned short here to save some
* space even though these are really mode_t values. */
-static const unsigned short mode_mask[] = {
+static const unsigned short mode_mask[] ALIGN2 = {
/* SST sst xxx --- */
S_ISUID, S_ISUID|S_IXUSR, S_IXUSR, 0, /* user */
S_ISGID, S_ISGID|S_IXGRP, S_IXGRP, 0, /* group */
@@ -255,7 +255,7 @@ static void parse_config_file(void)
for (i = 0; i < 3; i++) {
/* There are 4 chars + 1 nul for each of user/group/other. */
- static const char mode_chars[] = "Ssx-\0" "Ssx-\0" "Ttx-";
+ static const char mode_chars[] ALIGN1 = "Ssx-\0" "Ssx-\0" "Ttx-";
const char *q;
q = strchrnul(mode_chars + 5*i, *e++);
@@ -499,8 +499,8 @@ static void install_links(const char *busybox, int use_symbolic_links)
/* directory table
* this should be consistent w/ the enum,
* busybox.h::bb_install_loc_t, or else... */
- static const char usr_bin [] = "/usr/bin";
- static const char usr_sbin[] = "/usr/sbin";
+ static const char usr_bin [] ALIGN1 = "/usr/bin";
+ static const char usr_sbin[] ALIGN1 = "/usr/sbin";
static const char *const install_dir[] = {
&usr_bin [8], /* "", equivalent to "/" for concat_path_file() */
&usr_bin [4], /* "/bin" */
diff --git a/applets/usage_compressed b/applets/usage_compressed
index fd581cc66..9da683088 100755
--- a/applets/usage_compressed
+++ b/applets/usage_compressed
@@ -12,7 +12,7 @@ sz=`"$loc/usage" | wc -c` || exit 1
exec >"$target"
-echo 'static const char packed_usage[] = '
+echo 'static const char packed_usage[] ALIGN1 = '
"$loc/usage" | bzip2 -1 | od -v -t x1 \
| $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
echo ';'