[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNASg+Z0Vx+9ORpuv_5RdgzH4RDfGNEz5nEz71S_j7H18eQ@mail.gmail.com>
Date: Fri, 22 Dec 2023 16:01:30 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: deller@...nel.org, linux-kernel@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>, linux-modules@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH 1/4] linux/export: Fix alignment for 64-bit ksymtab entries
On Fri, Dec 22, 2023 at 3:08 PM Luis Chamberlain <mcgrof@...nel.org> wrote:
>
> On Thu, Dec 21, 2023 at 10:07:13PM -0800, Luis Chamberlain wrote:
> >
> > If we want to go bananas we could even get a graph of size of modules
>
> Sorry I meant size of number of symbols Vs cost.
>
> Luis
But, 1/4 is really a bug-fix, isn't it?
ksymtab was previously 8-byte aligned for CONFIG_64BIT,
but now is only 4-byte aligned.
$ git show ddb5cdbafaaa^:include/linux/export.h |
head -n66 | tail -n5
struct kernel_symbol {
unsigned long value;
const char *name;
const char *namespace;
};
$ git show ddb5cdbafaaa^:include/asm-generic/export.h |
head -23 | tail -8
#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
#define KSYM_ALIGN 4
#elif defined(CONFIG_64BIT)
#define KSYM_ALIGN 8
#else
#define KSYM_ALIGN 4
#endif
In the old behavior, <linux/export.h> used C code
for producing ksymtab, hence it was naturally
aligned by the compiler. (unsigned long and pointer
require 8-byte alignment for CONFIG_64BIT)
<asm-generic/export.h> explicitly required
8-byte alignment for CONFIG_64BIT.
In the current behavior, <linux/export-internal.h>
produces all ksymtab by using inline assembler,
but it hard-codes ".balign 4".
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists