1. 02 Oct, 2022 4 commits
    • Masahiro Yamada's avatar
      kbuild: reuse mksysmap output for kallsyms · 94ff2f63
      Masahiro Yamada authored
      scripts/mksysmap internally runs ${NM} (dropping some symbols).
      
      When CONFIG_KALLSYMS=y, mksysmap creates .tmp_System.map, but it is
      almost the same as the output from the ${NM} invocation in kallsyms().
      It is true scripts/mksysmap drops some symbols, but scripts/kallsyms.c
      ignores more anyway.
      
      Keep the mksysmap output as *.syms, and reuse it for kallsyms and
      'cmp -s'. It saves one ${NM} invocation.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      94ff2f63
    • Masahiro Yamada's avatar
      mksysmap: update comment about __crc_* · c1346169
      Masahiro Yamada authored
      Since commit 7b453719 ("kbuild: link symbol CRCs at final link,
      removing CONFIG_MODULE_REL_CRCS"), __crc_* symbols never become
      absolute.
      
      Keep ignoring __crc_*, but update the comment.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      c1346169
    • Masahiro Yamada's avatar
      kbuild: remove head-y syntax · ce697cce
      Masahiro Yamada authored
      Kbuild puts the objects listed in head-y at the head of vmlinux.
      Conventionally, we do this for head*.S, which contains the kernel entry
      point.
      
      A counter approach is to control the section order by the linker script.
      Actually, the code marked as __HEAD goes into the ".head.text" section,
      which is placed before the normal ".text" section.
      
      I do not know if both of them are needed. From the build system
      perspective, head-y is not mandatory. If you can achieve the proper code
      placement by the linker script only, it would be cleaner.
      
      I collected the current head-y objects into head-object-list.txt. It is
      a whitelist. My hope is it will be reduced in the long run.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
      ce697cce
    • Masahiro Yamada's avatar
      kbuild: use obj-y instead extra-y for objects placed at the head · 32164845
      Masahiro Yamada authored
      The objects placed at the head of vmlinux need special treatments:
      
       - arch/$(SRCARCH)/Makefile adds them to head-y in order to place
         them before other archives in the linker command line.
      
       - arch/$(SRCARCH)/kernel/Makefile adds them to extra-y instead of
         obj-y to avoid them going into built-in.a.
      
      This commit gets rid of the latter.
      
      Create vmlinux.a to collect all the objects that are unconditionally
      linked to vmlinux. The objects listed in head-y are moved to the head
      of vmlinux.a by using 'ar m'.
      
      With this, arch/$(SRCARCH)/kernel/Makefile can consistently use obj-y
      for builtin objects.
      
      There is no *.o that is directly linked to vmlinux. Drop unneeded code
      in scripts/clang-tools/gen_compile_commands.py.
      
      $(AR) mPi needs 'T' to workaround the llvm-ar bug. The fix was suggested
      by Nathan Chancellor [1].
      
      [1]: https://lore.kernel.org/llvm/YyjjT5gQ2hGMH0ni@dev-arch.thelio-3990X/Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
      32164845
  2. 28 Sep, 2022 28 commits
  3. 25 Sep, 2022 8 commits