Skip to content
  • Wanlong Gao's avatar
    modpost: abort if module name is too long · 4fd3e4ef
    Wanlong Gao authored
    
    
    Module name has a limited length, but currently the build system
    allows the build finishing even if the module name is too long.
    
      CC      /root/kprobe_example/abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.mod.o
     /root/kprobe_example/abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.mod.c:9:2:
     warning: initializer-string for array of chars is too long [enabled by default]
      .name = KBUILD_MODNAME,
      ^
    
    but it's merely a warning.
    
    This patch adds the check of the module name length in modpost and stops
    the build properly.
    
    Signed-off-by: default avatarWanlong Gao <wanlong.gao@gmail.com>
    Signed-off-by: default avatarJessica Yu <jeyu@kernel.org>
    4fd3e4ef