#include "libbb.h"
#include "bb_archive.h"
-const char cpio_TRAILER[] = "TRAILER!!!";
+const char cpio_TRAILER[] ALIGN1 = "TRAILER!!!";
* chksum_out
* The rest is identical.
*/
-static const unsigned char lzop_magic[9] = {
+static const unsigned char lzop_magic[9] ALIGN1 = {
0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a
};
if (overwrite == O_PROMPT)
overwrite = O_NEVER;
} else {
- static const char extn[][5] = { ".zip", ".ZIP" };
+ static const char extn[][5] ALIGN1 = { ".zip", ".ZIP" };
char *ext = src_fn + strlen(src_fn);
int src_fd;
#define MI_ENTRY(N,T,F,B,M) N "\0"
/* Mode names given on command line */
-static const char mode_name[] =
+static const char mode_name[] ALIGN1 =
MI_ENTRY("evenp", combination, REV | OMIT, 0, 0 )
MI_ENTRY("parity", combination, REV | OMIT, 0, 0 )
MI_ENTRY("oddp", combination, REV | OMIT, 0, 0 )
#define CI_ENTRY(n,s,o) n "\0"
/* Name given on command line */
-static const char control_name[] =
+static const char control_name[] ALIGN1 =
CI_ENTRY("intr", CINTR, VINTR )
CI_ENTRY("quit", CQUIT, VQUIT )
CI_ENTRY("erase", CERASE, VERASE )
#undef CI_ENTRY
#define CI_ENTRY(n,s,o) { s, o },
-static const struct control_info control_info[] = {
+static const struct control_info control_info[] ALIGN2 = {
/* This should be verbatim cut-n-paste copy of the above CI_ENTRYs */
CI_ENTRY("intr", CINTR, VINTR )
CI_ENTRY("quit", CQUIT, VQUIT )
EXT2_TOPDIR_FL
};
-const char e2attr_flags_sname[] =
+const char e2attr_flags_sname[] ALIGN1 =
#ifdef ENABLE_COMPRESSION
"BZXE"
#endif
"I"
"suSDiadAcjtT";
-static const char e2attr_flags_lname[] =
+static const char e2attr_flags_lname[] ALIGN1 =
#ifdef ENABLE_COMPRESSION
"Compressed_File" "\0"
"Compressed_Dirty_File" "\0"
*/
static const char *parse_cmd_args(sed_cmd_t *sed_cmd, const char *cmdstr)
{
- static const char cmd_letters[] = "saicrw:btTydDgGhHlnNpPqx={}";
+ static const char cmd_letters[] ALIGN1 = "saicrw:btTydDgGhHlnNpPqx={}";
enum {
IDX_s = 0,
IDX_a,
// cmds modifying text[]
// vda: removed "aAiIs" as they switch us into insert mode
// and remembering input for replay after them makes no sense
-static const char modifying_cmds[] = "cCdDJoOpPrRxX<>~";
+static const char modifying_cmds[] ALIGN1 = "cCdDJoOpPrRxX<>~";
#endif
enum {
* Since we unmount it at once, we can mount it anywhere.
* Try a few locations which are likely ti exist.
*/
- static const char dirs[] = "/mnt\0""/tmp\0""/boot\0""/proc\0";
+ static const char dirs[] ALIGN1 = "/mnt\0""/tmp\0""/boot\0""/proc\0";
const char *try_dir = dirs;
while (mount("none", try_dir, "tmpfs", MS_SILENT, "size=16m") != 0) {
try_dir += strlen(try_dir) + 1;
/* The previous version used "0pcCd?bB-?l?s???". However, the '0', 'C',
* and 'B' types don't appear to be available on linux. So I removed them. */
-static const char type_chars[16] = "?pc?d?b?-?l?s???";
+static const char type_chars[16] ALIGN1 = "?pc?d?b?-?l?s???";
/********************************** 0123456789abcdef */
-static const char mode_chars[7] = "rwxSTst";
+static const char mode_chars[7] ALIGN1 = "rwxSTst";
const char* FAST_FUNC bb_mode_string(mode_t mode)
{
#include "libbb.h"
-/* static const uint8_t ascii64[] =
+/* static const uint8_t ascii64[] ALIGN1 =
* "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
*/
/* Believe it or not, but some arches have more than 32 SIGs!
* HPPA: SIGSTKFLT == 36. */
-static const char signals[][7] = {
+static const char signals[][7] ALIGN1 = {
// SUSv3 says kill must support these, and specifies the numerical values,
// http://www.opengroup.org/onlinepubs/009695399/utilities/kill.html
// {0, "EXIT"}, {1, "HUP"}, {2, "INT"}, {3, "QUIT"},
# include <sys/timex.h>
#endif
-static const uint16_t statlist_bit[] = {
+static const uint16_t statlist_bit[] ALIGN2 = {
STA_PLL,
STA_PPSFREQ,
STA_PPSTIME,
STA_CLOCKERR,
0
};
-static const char statlist_name[] =
+static const char statlist_name[] ALIGN1 =
"PLL" "\0"
"PPSFREQ" "\0"
"PPSTIME" "\0"
"CLOCKERR"
;
-static const char ret_code_descript[] =
+static const char ret_code_descript[] ALIGN1 =
"clock synchronized" "\0"
"insert leap second" "\0"
"delete leap second" "\0"
#if ENABLE_FEATURE_EJECT_SCSI
static void eject_scsi(const char *dev)
{
- static const char sg_commands[3][6] = {
+ static const char sg_commands[3][6] ALIGN1 = {
{ ALLOW_MEDIUM_REMOVAL, 0, 0, 0, 0, 0 },
{ START_STOP, 0, 0, 0, 1, 0 },
{ START_STOP, 0, 0, 0, 2, 0 }
IOPRIO_CLASS_IDLE
};
-static const char to_prio[] = "none\0realtime\0best-effort\0idle";
+static const char to_prio[] ALIGN1 = "none\0realtime\0best-effort\0idle";
#define IOPRIO_CLASS_SHIFT 13
#define CTL_CLOSE (1 << 3)
#define CTL_NODIE (1 << 4)
-static const char serial_types[] =
+static const char serial_types[] ALIGN1 =
"unknown\0" /* 0 */
"8250\0" /* 1 */
"16450\0" /* 2 */
# define MAX_SERIAL_TYPE 13
#endif
-static const char commands[] =
+static const char commands[] ALIGN1 =
"spd_normal\0"
"spd_hi\0"
"spd_vhi\0"
ASYNC_LOW_LATENCY
};
-static const char STR_INFINITE[] = "infinite";
-static const char STR_NONE[] = "none";
+#define STR_INFINITE "infinite"
+#define STR_NONE "none"
static const char *uart_type(int type)
{
"stale\0" "incomplete\0" "delay\0" "probe\0"
"failed\0"
;
- static uint8_t nuds[] = {
+ static uint8_t nuds[] ALIGN1 = {
NUD_PERMANENT,NUD_REACHABLE, NUD_NOARP,NUD_NONE,
NUD_STALE, NUD_INCOMPLETE,NUD_DELAY,NUD_PROBE,
NUD_FAILED
/* Keep declarations above and below in sync! */
-static const char llproto_names[] =
+static const char llproto_names[] ALIGN1 =
#define __PF(f,n) #n "\0"
__PF(LOOP,loop)
__PF(PUP,pup)
const char* FAST_FUNC ll_type_n2a(int type, char *buf)
{
- static const char arphrd_name[] =
+ static const char arphrd_name[] ALIGN1 =
/* 0, */ "generic" "\0"
/* ARPHRD_LOOPBACK, */ "loopback" "\0"
/* ARPHRD_ETHER, */ "ether" "\0"
/* Keep these arrays in sync! */
- static const uint16_t arphrd_type[] = {
+ static const uint16_t arphrd_type[] ALIGN2 = {
0, /* "generic" "\0" */
ARPHRD_LOOPBACK, /* "loopback" "\0" */
ARPHRD_ETHER, /* "ether" "\0" */
#endif
+#ifdef TIOCPKT
+ int control;
-+ static const char lflow_on[] =
++ static const char lflow_on[] ALIGN1 =
+ {IAC, SB, TELOPT_LFLOW, LFLOW_ON, IAC, SE};
-+ static const char lflow_off[] =
++ static const char lflow_off[] ALIGN1 =
+ {IAC, SB, TELOPT_LFLOW, LFLOW_OFF, IAC, SE};
+# define RESERVED sizeof(lflow_on)
+#else
/*** Script execution code ***/
/* get a rough idea of how long an option will be (rounding up...) */
-static const uint8_t len_of_option_as_string[] = {
+static const uint8_t len_of_option_as_string[] ALIGN1 = {
[OPTION_IP ] = sizeof("255.255.255.255 "),
[OPTION_IP_PAIR ] = sizeof("255.255.255.255 ") * 2,
[OPTION_STATIC_ROUTES ] = sizeof("255.255.255.255/32 255.255.255.255 "),
char *host;
int port;
};
-static const char P_FTP[] = "ftp";
-static const char P_HTTP[] = "http";
+static const char P_FTP[] ALIGN1 = "ftp";
+static const char P_HTTP[] ALIGN1 = "http";
#if ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER
-static const char P_HTTPS[] = "https";
+static const char P_HTTPS[] ALIGN1 = "https";
#endif
#if ENABLE_FEATURE_WGET_LONG_OPTIONS
static NOINLINE int read_cpu_jiffy(FILE *fp, jiffy_counts_t *p_jif)
{
#if !ENABLE_FEATURE_TOP_SMP_CPU
- static const char fmt[] = "cpu %llu %llu %llu %llu %llu %llu %llu %llu";
+ static const char fmt[] ALIGN1 = "cpu %llu %llu %llu %llu %llu %llu %llu %llu";
#else
- static const char fmt[] = "cp%*s %llu %llu %llu %llu %llu %llu %llu %llu";
+ static const char fmt[] ALIGN1 = "cp%*s %llu %llu %llu %llu %llu %llu %llu %llu";
#endif
int ret;
static void parse_meminfo(unsigned long meminfo[MI_MAX])
{
- static const char fields[] =
+ static const char fields[] ALIGN1 =
"MemTotal\0"
"MemFree\0"
"MemShared\0"
#else
# define SIT_ITEM(a,b,c,d) (a | (b << 4) | (c << 8))
#endif
-static const uint16_t S_I_T[] = {
+static const uint16_t S_I_T[] ALIGN2 = {
#if ENABLE_ASH_ALIAS
SIT_ITEM(CSPCL , CIGN , CIGN , CIGN ), /* 0, PEOA */
#endif
#else /* !USE_SIT_FUNCTION */
-static const uint8_t syntax_index_table[] = {
+static const uint8_t syntax_index_table[] ALIGN1 = {
/* BASESYNTAX_DQSYNTAX_SQSYNTAX_ARISYNTAX */
/* 0 */ CWORD_CWORD_CWORD_CWORD,
/* 1 */ CWORD_CWORD_CWORD_CWORD,
#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
#define EV_BACKCMD 04 /* command executing within back quotes */
-static const uint8_t nodesize[N_NUMBER] = {
+static const uint8_t nodesize[N_NUMBER] ALIGN1 = {
[NCMD ] = SHELL_ALIGN(sizeof(struct ncmd)),
[NPIPE ] = SHELL_ALIGN(sizeof(struct npipe)),
[NREDIR ] = SHELL_ALIGN(sizeof(struct nredir)),
};
/* "-": treat args as parameters of option with ASCII code 1 */
-static const char ulimit_opt_string[] = "-HSa"
+static const char ulimit_opt_string[] ALIGN1 = "-HSa"
#ifdef RLIMIT_FSIZE
"f::"
#endif
* Extra space at the end is a hack to print space separator in file listing.
* Let's hope no one ever passes space as an option char :)
*/
-static const char bit_to_char[] = "rhsvda67 ";
+static const char bit_to_char[] ALIGN1 = "rhsvda67 ";
static inline unsigned long get_flag(char c)
{
/* "remount" */ MS_REMOUNT // action flag
};
-static const char mount_option_str[] =
+static const char mount_option_str[] ALIGN1 =
IF_FEATURE_MOUNT_LOOP(
"loop\0"
)
# define EDQUOT ENOSPC
#endif
/* Convert each NFSERR_BLAH into EBLAH */
-static const uint8_t nfs_err_stat[] = {
+static const uint8_t nfs_err_stat[] ALIGN1 = {
1, 2, 5, 6, 13, 17,
19, 20, 21, 22, 27, 28,
30, 63, 66, 69, 70, 71
#else
typedef uint16_t nfs_err_type;
#endif
-static const nfs_err_type nfs_err_errnum[] = {
+static const nfs_err_type nfs_err_errnum[] ALIGN2 = {
EPERM , ENOENT , EIO , ENXIO , EACCES, EEXIST,
ENODEV, ENOTDIR , EISDIR , EINVAL, EFBIG , ENOSPC,
EROFS , ENAMETOOLONG, ENOTEMPTY, EDQUOT, ESTALE, EREMOTE
/*
* Upstream nsenter doesn't support the short option for --preserve-credentials
*/
-static const char opt_str[] = "U::i::u::n::p::m::""t+S+G+r::w::F";
+static const char opt_str[] ALIGN1 = "U::i::u::n::p::m::""t+S+G+r::w::F";
#if ENABLE_FEATURE_NSENTER_LONG_OPTS
static const char nsenter_longopts[] ALIGN1 =
* we are forced to use "fake" letters for them.
* '+': stop at first non-option.
*/
-static const char opt_str[] = "+muinpU""fr""\xfd::""\xfe:""\xff:";
+static const char opt_str[] ALIGN1 = "+muinpU""fr""\xfd::""\xfe:""\xff:";
static const char unshare_longopts[] ALIGN1 =
"mount\0" Optional_argument "\xf0"
"uts\0" Optional_argument "\xf1"
#define SB_LABEL_SIZE 32
#define SB_JOURNAL_BUCKETS 256U
-static const char bcache_magic[] = {
+static const char bcache_magic[] ALIGN1 = {
0xc6, 0x85, 0x73, 0xf6, 0x4e, 0x1a, 0x45, 0xca,
0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81
};
#define LUKS_SALTSIZE 32
#define LUKS_NUMKEYS 8
-static const uint8_t LUKS_MAGIC[] = { 'L','U','K','S', 0xba, 0xbe };
+static const uint8_t LUKS_MAGIC[] ALIGN1 = { 'L','U','K','S', 0xba, 0xbe };
struct luks_phdr {
uint8_t magic[LUKS_MAGIC_L];