summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-12 20:58:27 +0000
commit6ca409e0e4c198fe3081346eebbae3f068fe605a (patch)
tree060cb05d99220a1eda399194d1209c269f0e8cd8 /applets
parent4185548984357df91311f30c8e43d95f33922576 (diff)
downloadbusybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.gz
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.tar.bz2
busybox-w32-6ca409e0e4c198fe3081346eebbae3f068fe605a.zip
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
20HOSTCFLAGS_usage.o = -I$(srctree)/include 20HOSTCFLAGS_usage.o = -I$(srctree)/include
21 21
22applets/applets.o: include/usage_compressed.h 22applets/applets.o: include/usage_compressed.h
23applets/usage: .config 23applets/usage: .config $(srctree)/applets/usage_compressed
24include/usage_compressed.h: applets/usage 24include/usage_compressed.h: applets/usage $(srctree)/applets/usage_compressed
25 $(call cmd,gen_usage_compressed) 25 $(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 @@
34 34
35#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE 35#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
36/* Define usage_messages[] */ 36/* Define usage_messages[] */
37static const char usage_messages[] = "" 37static const char usage_messages[] ALIGN1 = ""
38#define MAKE_USAGE 38#define MAKE_USAGE
39#include "usage.h" 39#include "usage.h"
40#include "applets.h" 40#include "applets.h"
@@ -108,12 +108,12 @@ static char *get_trimmed_slice(char *s, char *e)
108} 108}
109 109
110/* Don't depend on the tools to combine strings. */ 110/* Don't depend on the tools to combine strings. */
111static const char config_file[] = "/etc/busybox.conf"; 111static const char config_file[] ALIGN1 = "/etc/busybox.conf";
112 112
113/* We don't supply a value for the nul, so an index adjustment is 113/* We don't supply a value for the nul, so an index adjustment is
114 * necessary below. Also, we use unsigned short here to save some 114 * necessary below. Also, we use unsigned short here to save some
115 * space even though these are really mode_t values. */ 115 * space even though these are really mode_t values. */
116static const unsigned short mode_mask[] = { 116static const unsigned short mode_mask[] ALIGN2 = {
117 /* SST sst xxx --- */ 117 /* SST sst xxx --- */
118 S_ISUID, S_ISUID|S_IXUSR, S_IXUSR, 0, /* user */ 118 S_ISUID, S_ISUID|S_IXUSR, S_IXUSR, 0, /* user */
119 S_ISGID, S_ISGID|S_IXGRP, S_IXGRP, 0, /* group */ 119 S_ISGID, S_ISGID|S_IXGRP, S_IXGRP, 0, /* group */
@@ -255,7 +255,7 @@ static void parse_config_file(void)
255 255
256 for (i = 0; i < 3; i++) { 256 for (i = 0; i < 3; i++) {
257 /* There are 4 chars + 1 nul for each of user/group/other. */ 257 /* There are 4 chars + 1 nul for each of user/group/other. */
258 static const char mode_chars[] = "Ssx-\0" "Ssx-\0" "Ttx-"; 258 static const char mode_chars[] ALIGN1 = "Ssx-\0" "Ssx-\0" "Ttx-";
259 259
260 const char *q; 260 const char *q;
261 q = strchrnul(mode_chars + 5*i, *e++); 261 q = strchrnul(mode_chars + 5*i, *e++);
@@ -499,8 +499,8 @@ static void install_links(const char *busybox, int use_symbolic_links)
499 /* directory table 499 /* directory table
500 * this should be consistent w/ the enum, 500 * this should be consistent w/ the enum,
501 * busybox.h::bb_install_loc_t, or else... */ 501 * busybox.h::bb_install_loc_t, or else... */
502 static const char usr_bin [] = "/usr/bin"; 502 static const char usr_bin [] ALIGN1 = "/usr/bin";
503 static const char usr_sbin[] = "/usr/sbin"; 503 static const char usr_sbin[] ALIGN1 = "/usr/sbin";
504 static const char *const install_dir[] = { 504 static const char *const install_dir[] = {
505 &usr_bin [8], /* "", equivalent to "/" for concat_path_file() */ 505 &usr_bin [8], /* "", equivalent to "/" for concat_path_file() */
506 &usr_bin [4], /* "/bin" */ 506 &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
12 12
13exec >"$target" 13exec >"$target"
14 14
15echo 'static const char packed_usage[] = ' 15echo 'static const char packed_usage[] ALIGN1 = '
16"$loc/usage" | bzip2 -1 | od -v -t x1 \ 16"$loc/usage" | bzip2 -1 | od -v -t x1 \
17| $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' 17| $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
18echo ';' 18echo ';'