• Ard Biesheuvel's avatar
    ACPI: tables: avoid relocations for table signature array · 2229a12b
    Ard Biesheuvel authored
    On architectures that implement KASLR using the ELF native RELA relocation
    format (such as arm64), every absolute reference in the code incurs an
    overhead of 24 bytes in the .rela section. So storing a 41 element array
    of 4 character signature strings using an array of pointer-to-char incurs
    an 8x overhead (32 bytes per entry => ~1500 bytes), and given the fixed
    length of the entries, and the fact that the array is only used locally,
    it is much better to use an array of arrays here, which gets rid of the
    overhead entirely.
    
    While at it, make it __initconst, as it is never referenced except from
    __init code.
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    2229a12b
tables.c 22.4 KB