Commit 505e701c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'kbuild-fixes-v6.7-2' of...

Merge tag 'kbuild-fixes-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Revive proper alignment for the ksymtab and kcrctab sections

 - Fix gen_compile_commands.py tool to resolve symbolic links

 - Fix symbolic links to installed debug VDSO files

 - Update MAINTAINERS

* tag 'kbuild-fixes-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  linux/export: Ensure natural alignment of kcrctab array
  kbuild: fix build ID symlinks to installed debug VDSO files
  gen_compile_commands.py: fix path resolve with symlinks in it
  MAINTAINERS: Add scripts/clang-tools to Kbuild section
  linux/export: Fix alignment for 64-bit ksymtab entries
parents eeec2599 753547de
...@@ -11469,6 +11469,7 @@ F: scripts/*vmlinux* ...@@ -11469,6 +11469,7 @@ F: scripts/*vmlinux*
F: scripts/Kbuild* F: scripts/Kbuild*
F: scripts/Makefile* F: scripts/Makefile*
F: scripts/basic/ F: scripts/basic/
F: scripts/clang-tools/
F: scripts/dummy-tools/ F: scripts/dummy-tools/
F: scripts/mk* F: scripts/mk*
F: scripts/mod/ F: scripts/mod/
......
...@@ -16,10 +16,13 @@ ...@@ -16,10 +16,13 @@
* and eliminates the need for absolute relocations that require runtime * and eliminates the need for absolute relocations that require runtime
* processing on relocatable kernels. * processing on relocatable kernels.
*/ */
#define __KSYM_ALIGN ".balign 4"
#define __KSYM_REF(sym) ".long " #sym "- ." #define __KSYM_REF(sym) ".long " #sym "- ."
#elif defined(CONFIG_64BIT) #elif defined(CONFIG_64BIT)
#define __KSYM_ALIGN ".balign 8"
#define __KSYM_REF(sym) ".quad " #sym #define __KSYM_REF(sym) ".quad " #sym
#else #else
#define __KSYM_ALIGN ".balign 4"
#define __KSYM_REF(sym) ".long " #sym #define __KSYM_REF(sym) ".long " #sym
#endif #endif
...@@ -42,7 +45,7 @@ ...@@ -42,7 +45,7 @@
" .asciz \"" ns "\"" "\n" \ " .asciz \"" ns "\"" "\n" \
" .previous" "\n" \ " .previous" "\n" \
" .section \"___ksymtab" sec "+" #name "\", \"a\"" "\n" \ " .section \"___ksymtab" sec "+" #name "\", \"a\"" "\n" \
" .balign 4" "\n" \ __KSYM_ALIGN "\n" \
"__ksymtab_" #name ":" "\n" \ "__ksymtab_" #name ":" "\n" \
__KSYM_REF(sym) "\n" \ __KSYM_REF(sym) "\n" \
__KSYM_REF(__kstrtab_ ##name) "\n" \ __KSYM_REF(__kstrtab_ ##name) "\n" \
...@@ -61,6 +64,7 @@ ...@@ -61,6 +64,7 @@
#define SYMBOL_CRC(sym, crc, sec) \ #define SYMBOL_CRC(sym, crc, sec) \
asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \ asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \
".balign 4" "\n" \
"__crc_" #sym ":" "\n" \ "__crc_" #sym ":" "\n" \
".long " #crc "\n" \ ".long " #crc "\n" \
".previous" "\n") ".previous" "\n")
......
...@@ -22,7 +22,7 @@ $$(dest): $$(src) FORCE ...@@ -22,7 +22,7 @@ $$(dest): $$(src) FORCE
# Some architectures create .build-id symlinks # Some architectures create .build-id symlinks
ifneq ($(filter arm sparc x86, $(SRCARCH)),) ifneq ($(filter arm sparc x86, $(SRCARCH)),)
link := $(install-dir)/.build-id/$$(shell $(READELF) -n $$(src) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p') link := $(install-dir)/.build-id/$$(shell $(READELF) -n $$(src) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p').debug
__default: $$(link) __default: $$(link)
$$(link): $$(dest) FORCE $$(link): $$(dest) FORCE
......
...@@ -64,7 +64,7 @@ def parse_arguments(): ...@@ -64,7 +64,7 @@ def parse_arguments():
args = parser.parse_args() args = parser.parse_args()
return (args.log_level, return (args.log_level,
os.path.abspath(args.directory), os.path.realpath(args.directory),
args.output, args.output,
args.ar, args.ar,
args.paths if len(args.paths) > 0 else [args.directory]) args.paths if len(args.paths) > 0 else [args.directory])
...@@ -172,8 +172,8 @@ def process_line(root_directory, command_prefix, file_path): ...@@ -172,8 +172,8 @@ def process_line(root_directory, command_prefix, file_path):
# by Make, so this code replaces the escaped version with '#'. # by Make, so this code replaces the escaped version with '#'.
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#') prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
# Use os.path.abspath() to normalize the path resolving '.' and '..' . # Return the canonical path, eliminating any symbolic links encountered in the path.
abs_path = os.path.abspath(os.path.join(root_directory, file_path)) abs_path = os.path.realpath(os.path.join(root_directory, file_path))
if not os.path.exists(abs_path): if not os.path.exists(abs_path):
raise ValueError('File %s not found' % abs_path) raise ValueError('File %s not found' % abs_path)
return { return {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment