Skip to contentSkip to conversation

kallsyms: clean up alignment (potentially save a few bytes on ARM)

PATCH New Alan Jenkins 1 participant 1 message Oct 25, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kallsyms: clean up alignment (potentially save a few bytes on ARM)

On ARM, .align N means "align to 2^N bytes". What we actually want is "align to N bytes".

Let's use the .balign directive of gnu as, which is explicitly defined to address this issue.

---
 scripts/kallsyms.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
scripts/kallsyms.c +2 -2
index 86c3896..55de9e8 100644
@@ -297,10 +297,10 @@ static void write_src(void)
 	printf("#include <asm/types.h>\n");
 	printf("#if BITS_PER_LONG == 64\n");
 	printf("#define PTR .quad\n");
-	printf("#define ALGN .align 8\n");
+	printf("#define ALGN .balign 8\n");
 	printf("#else\n");
 	printf("#define PTR .long\n");
-	printf("#define ALGN .align 4\n");
+	printf("#define ALGN .balign 4\n");
 	printf("#endif\n");
 
 	printf("\t.section .rodata, \"a\"\n");