[PATCH v2 16/29] ARM: kernel: switch to relative exception tables
Ard Biesheuvel
ard.biesheuvel at linaro.org
Mon Sep 4 10:30:26 PDT 2017
On 4 September 2017 at 18:17, Nicolas Pitre <nicolas.pitre at linaro.org> wrote:
> On Sun, 3 Sep 2017, Ard Biesheuvel wrote:
>
>> To avoid having to relocate the contents of extable entries at
>> runtime when running with KASLR enabled, wire up the existing
>> support for emitting them as relative references. This ensures
>> these quantities are invariant under runtime relocation.
>>
>> Cc: Russell King <linux at armlinux.org.uk>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
>
> Could it be better to have a macro that encapsulates exception entries
> e.g.:
>
> .macro ex_entry insn fixup
> .long \insn - ., \fixup - .
> .endif
>
> so that if ever this changes again or for whatever reason someone needs
> absolute entries then this won't have to be done everywhere. The section
> switch could be included in such a macro too. And it is so easy to
> forget to do the "- ." when adding new entries.
>
Good point. I will change that.
More information about the linux-arm-kernel
mailing list