* [PATCH] kallsyms: lower alignment on ARM
@ 2018-12-30 12:36 Mathias Krause
2019-01-03 0:30 ` Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: Mathias Krause @ 2018-12-30 12:36 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-arch, linux-kernel, Mathias Krause, Catalin Marinas, Will Deacon
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 <minipli@googlemail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
scripts/kallsyms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 109a1af7e444..77cebad0474e 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -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");
--
2.19.2
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] kallsyms: lower alignment on ARM
2018-12-30 12:36 [PATCH] kallsyms: lower alignment on ARM Mathias Krause
@ 2019-01-03 0:30 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2019-01-03 0:30 UTC (permalink / raw)
To: Mathias Krause
Cc: linux-arch, Linux Kernel Mailing List, Catalin Marinas, Will Deacon
On Sun, Dec 30, 2018 at 9:37 PM Mathias Krause <minipli@googlemail.com> wrote:
>
> 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 <minipli@googlemail.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
Applied to linux-kbuild.
Thanks!
> ---
> scripts/kallsyms.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
> index 109a1af7e444..77cebad0474e 100644
> --- a/scripts/kallsyms.c
> +++ b/scripts/kallsyms.c
> @@ -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");
> --
> 2.19.2
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-03 0:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-30 12:36 [PATCH] kallsyms: lower alignment on ARM Mathias Krause
2019-01-03 0:30 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®