From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 3/6] module: use relative references for __ksymtab entries
Date: Wed, 27 Jun 2018 16:13:39 +0100 [thread overview]
Message-ID: <20180627151339.GD30631@arm.com> (raw)
In-Reply-To: <20180626182802.19932-4-ard.biesheuvel@linaro.org>
Hi Ard,
On Tue, Jun 26, 2018 at 08:27:58PM +0200, Ard Biesheuvel wrote:
> An ordinary arm64 defconfig build has ~64 KB worth of __ksymtab
> entries, each consisting of two 64-bit fields containing absolute
> references, to the symbol itself and to a char array containing
> its name, respectively.
[...]
> diff --git a/include/linux/export.h b/include/linux/export.h
> index ea7df303d68d..ae072bc5aacf 100644
> --- a/include/linux/export.h
> +++ b/include/linux/export.h
> @@ -18,12 +18,6 @@
> #define VMLINUX_SYMBOL_STR(x) __VMLINUX_SYMBOL_STR(x)
>
> #ifndef __ASSEMBLY__
> -struct kernel_symbol
> -{
> - unsigned long value;
> - const char *name;
> -};
> -
> #ifdef MODULE
> extern struct module __this_module;
> #define THIS_MODULE (&__this_module)
> @@ -54,17 +48,47 @@ extern struct module __this_module;
> #define __CRC_SYMBOL(sym, sec)
> #endif
>
> +#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
> +#include <linux/compiler.h>
> +/*
> + * Emit the ksymtab entry as a pair of relative references: this reduces
> + * the size by half on 64-bit architectures, and eliminates the need for
> + * absolute relocations that require runtime processing on relocatable
> + * kernels.
> + */
> +#define __KSYMTAB_ENTRY(sym, sec) \
> + __ADDRESSABLE(sym) \
> + asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
> + " .balign 8 \n" \
Can we use KSYM_ALIGN here instead of 8, or do we need the 8-byte alignment
even on 32-bit architectures?
Will
next prev parent reply other threads:[~2018-06-27 15:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 18:27 [PATCH v9 0/6] add support for relative references in special sections Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 1/6] arch: enable relative relocations for arm64, power and x86 Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 2/6] module: allow symbol exports to be disabled Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 3/6] module: use relative references for __ksymtab entries Ard Biesheuvel
2018-06-27 15:13 ` Will Deacon [this message]
2018-06-27 15:21 ` Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 4/6] init: allow initcall tables to be emitted using relative references Ard Biesheuvel
2018-06-26 19:13 ` James Morris
2018-06-27 14:20 ` Sergey Senozhatsky
2018-06-27 15:22 ` Petr Mladek
2018-06-30 10:16 ` kbuild test robot
2018-06-26 18:28 ` [PATCH v9 5/6] PCI: Add support for relative addressing in quirk tables Ard Biesheuvel
2018-06-26 18:28 ` [PATCH v9 6/6] kernel: tracepoints: add support for relative references Ard Biesheuvel
2018-06-27 5:33 ` [PATCH v9 0/6] add support for relative references in special sections Michael Ellerman
2018-06-27 15:15 ` Will Deacon
2018-07-01 17:39 ` Ard Biesheuvel
2018-07-03 8:38 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180627151339.GD30631@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).