Files
android_kernel_xiaomi_sm8450/include/linux
Matthias Maennich ed13fc33f7 export: explicitly align struct kernel_symbol
This change allows growing struct kernel_symbol without wasting bytes to
alignment. It also concretized the alignment of ksymtab entries if
relative references are used for ksymtab entries.

struct kernel_symbol was already implicitly being aligned to the word
size, except on x86_64 and m68k, where it is aligned to 16 and 2 bytes,
respectively.

As far as I can tell there is no requirement for aligning struct
kernel_symbol to 16 bytes on x86_64, but gcc aligns structs to their
size, and the linker aligns the custom __ksymtab sections to the largest
data type contained within, so setting KSYM_ALIGN to 16 was necessary to
stay consistent with the code generated for non-ASM EXPORT_SYMBOL(). Now
that non-ASM EXPORT_SYMBOL() explicitly aligns to word size (8),
KSYM_ALIGN is no longer necessary.

In case of relative references, the alignment has been changed
accordingly to not waste space when adding new struct members.

As for m68k, struct kernel_symbol is aligned to 2 bytes even though the
structure itself is 8 bytes; using a 4-byte alignment shouldn't hurt.

I manually verified the output of the __ksymtab sections didn't change
on x86, x86_64, arm, arm64 and m68k. As expected, the section contents
didn't change, and the ELF section alignment only changed on x86_64 and
m68k. Feedback from other archs more than welcome.

Co-developed-by: Martijn Coenen <maco@android.com>
Signed-off-by: Martijn Coenen <maco@android.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2019-09-10 10:30:09 +02:00
..
2019-06-20 09:23:22 +02:00
2019-05-31 11:13:10 +02:00
2019-08-15 15:18:05 +02:00
2019-07-10 09:00:57 -06:00
2019-05-14 19:52:50 -07:00
2019-07-01 08:18:54 -06:00
2019-08-15 11:09:16 -06:00
2019-04-09 17:05:46 -07:00
2019-05-07 08:39:02 -06:00
2019-06-12 20:27:13 +02:00
2019-07-18 09:49:30 +02:00
2019-02-28 03:28:53 -05:00
2019-06-12 20:30:39 +02:00
2019-02-28 08:24:23 -07:00
2019-07-23 13:59:33 -07:00
2019-04-22 09:48:12 -06:00
2019-07-05 21:34:50 +02:00
2019-06-26 13:19:46 -07:00
2019-06-10 13:00:24 +02:00
2019-04-08 22:56:14 +02:00
2019-08-19 09:43:57 -07:00
2019-07-05 15:19:10 -07:00
2019-03-07 18:32:03 -08:00
2019-07-08 19:25:19 -07:00
2019-06-13 09:02:33 -04:00
2019-07-09 14:15:37 -07:00
2019-07-26 17:01:29 -06:00
2019-08-12 10:47:55 +02:00
2019-07-16 19:23:25 -07:00
2019-05-14 19:52:51 -07:00
2019-06-12 11:42:13 +02:00
2019-06-15 12:25:49 +02:00
2019-05-14 19:52:48 -07:00
2019-04-02 17:57:35 +02:00
2019-05-08 22:14:36 +02:00
2019-05-31 12:37:46 -07:00
2019-05-16 15:51:55 -07:00
2019-07-08 10:51:25 +02:00
2019-07-12 11:05:43 -07:00
2019-06-27 21:22:15 +08:00
2019-07-07 11:50:03 +02:00
2019-08-15 15:18:05 +02:00
2019-05-15 17:35:54 +01:00
2019-07-18 10:20:13 -06:00
2019-07-10 09:00:57 -06:00