Skip to content

Commit

Permalink
kallsyms: lower alignment on ARM
Browse files Browse the repository at this point in the history
As mentioned in the info pages of gas, the '.align' pseudo op's
interpretation of the alignment value is architecture specific.
It might either be a byte value or taken to the power of two.

On ARM it's actually the latter which leads to unnecessary large
alignments of 16 bytes for 32 bit builds or 256 bytes for 64 bit
builds.

Fix this by switching to '.balign' instead which is consistent
across all architectures.

Signed-off-by: Mathias Krause <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
minipli authored and masahir0y committed Jan 6, 2019
1 parent c300331 commit 72d3ebb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,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");
Expand Down

0 comments on commit 72d3ebb

Please sign in to comment.