]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
uki: document section name size limit
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Sep 2023 11:56:29 +0000 (13:56 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 5 Sep 2023 13:38:13 +0000 (14:38 +0100)
src/fundamental/uki.c

index ec37d74e03584edae035be945150eea6e23bd5b2..b1fa04481341029bebf2c7c4a3bac255b82e0d29 100644 (file)
@@ -5,6 +5,10 @@
 #include "uki.h"
 
 const char* const unified_sections[_UNIFIED_SECTION_MAX + 1] = {
+        /* These section names must fit in 8ch (excluding any trailing NUL) as per PE spec for executables:
+         * https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#section-table-section-headers
+         * (Note that PE *object* files may have longer section names (via indirection in the string table) but
+         * this is not allowed for PE *executables*, which UKIs are.) */
         [UNIFIED_SECTION_LINUX]   = ".linux",
         [UNIFIED_SECTION_OSREL]   = ".osrel",
         [UNIFIED_SECTION_CMDLINE] = ".cmdline",