Skip to content

Commit 505e701

Browse files
committed
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
2 parents eeec259 + 753547d commit 505e701

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11469,6 +11469,7 @@ F: scripts/*vmlinux*
1146911469
F: scripts/Kbuild*
1147011470
F: scripts/Makefile*
1147111471
F: scripts/basic/
11472+
F: scripts/clang-tools/
1147211473
F: scripts/dummy-tools/
1147311474
F: scripts/mk*
1147411475
F: scripts/mod/

include/linux/export-internal.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
* and eliminates the need for absolute relocations that require runtime
1717
* processing on relocatable kernels.
1818
*/
19+
#define __KSYM_ALIGN ".balign 4"
1920
#define __KSYM_REF(sym) ".long " #sym "- ."
2021
#elif defined(CONFIG_64BIT)
22+
#define __KSYM_ALIGN ".balign 8"
2123
#define __KSYM_REF(sym) ".quad " #sym
2224
#else
25+
#define __KSYM_ALIGN ".balign 4"
2326
#define __KSYM_REF(sym) ".long " #sym
2427
#endif
2528

@@ -42,7 +45,7 @@
4245
" .asciz \"" ns "\"" "\n" \
4346
" .previous" "\n" \
4447
" .section \"___ksymtab" sec "+" #name "\", \"a\"" "\n" \
45-
" .balign 4" "\n" \
48+
__KSYM_ALIGN "\n" \
4649
"__ksymtab_" #name ":" "\n" \
4750
__KSYM_REF(sym) "\n" \
4851
__KSYM_REF(__kstrtab_ ##name) "\n" \
@@ -61,6 +64,7 @@
6164

6265
#define SYMBOL_CRC(sym, crc, sec) \
6366
asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \
67+
".balign 4" "\n" \
6468
"__crc_" #sym ":" "\n" \
6569
".long " #crc "\n" \
6670
".previous" "\n")

scripts/Makefile.vdsoinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $$(dest): $$(src) FORCE
2222

2323
# Some architectures create .build-id symlinks
2424
ifneq ($(filter arm sparc x86, $(SRCARCH)),)
25-
link := $(install-dir)/.build-id/$$(shell $(READELF) -n $$(src) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
25+
link := $(install-dir)/.build-id/$$(shell $(READELF) -n $$(src) | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p').debug
2626

2727
__default: $$(link)
2828
$$(link): $$(dest) FORCE

scripts/clang-tools/gen_compile_commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def parse_arguments():
6464
args = parser.parse_args()
6565

6666
return (args.log_level,
67-
os.path.abspath(args.directory),
67+
os.path.realpath(args.directory),
6868
args.output,
6969
args.ar,
7070
args.paths if len(args.paths) > 0 else [args.directory])
@@ -172,8 +172,8 @@ def process_line(root_directory, command_prefix, file_path):
172172
# by Make, so this code replaces the escaped version with '#'.
173173
prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#')
174174

175-
# Use os.path.abspath() to normalize the path resolving '.' and '..' .
176-
abs_path = os.path.abspath(os.path.join(root_directory, file_path))
175+
# Return the canonical path, eliminating any symbolic links encountered in the path.
176+
abs_path = os.path.realpath(os.path.join(root_directory, file_path))
177177
if not os.path.exists(abs_path):
178178
raise ValueError('File %s not found' % abs_path)
179179
return {

0 commit comments

Comments
 (0)