From 965b795b87c59ed45cc7f16a62301dbae65b1627 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 30 Nov 2020 13:03:03 +0100 Subject: decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nilly text data bss dec hex filename 1021988 559 5052 1027599 fae0f busybox_old 1021236 559 5052 1026847 fab1f busybox_unstripped Signed-off-by: Denys Vlasenko --- include/libbb.h | 3 ++- include/platform.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 18dc9f935..9872dc1fb 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1026,8 +1026,9 @@ void generate_uuid(uint8_t *buf) FAST_FUNC; /* Last element is marked by mult == 0 */ struct suffix_mult { char suffix[4]; - unsigned mult; + uint32_t mult; }; +#define ALIGN_SUFFIX ALIGN4 extern const struct suffix_mult bkm_suffixes[]; #define km_suffixes (bkm_suffixes + 1) extern const struct suffix_mult cwbkMG_suffixes[]; diff --git a/include/platform.h b/include/platform.h index 43bb391bd..085387fd8 100644 --- a/include/platform.h +++ b/include/platform.h @@ -342,6 +342,8 @@ typedef unsigned smalluint; # define ALIGN2 # define ALIGN4 #endif +#define ALIGN8 __attribute__((aligned(8))) +#define ALIGN_PTR __attribute__((aligned(sizeof(void*)))) /* * For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably. -- cgit v1.2.3