Skip to content

Commit

Permalink
Merge tag 'kbuild-fixes-v5.9-4' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - ignore compiler stubs for PPC to fix builds

 - fix the usage of --target mentioned in the LLVM document

* tag 'kbuild-fixes-v5.9-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  Documentation/llvm: Fix clang target examples
  scripts/kallsyms: skip ppc compiler stub *.long_branch.* / *.plt_branch.*
  • Loading branch information
torvalds committed Sep 27, 2020
2 parents f881855 + e30d694 commit 16bc1d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Documentation/kbuild/llvm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ which can help simplify cross compiling. ::
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang

``CROSS_COMPILE`` is not used to prefix the Clang compiler binary, instead
``CROSS_COMPILE`` is used to set a command line flag: ``--target <triple>``. For
``CROSS_COMPILE`` is used to set a command line flag: ``--target=<triple>``. For
example: ::

clang --target aarch64-linux-gnu foo.c
clang --target=aarch64-linux-gnu foo.c

LLVM Utilities
--------------
Expand Down
16 changes: 15 additions & 1 deletion scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static char *sym_name(const struct sym_entry *s)

static bool is_ignored_symbol(const char *name, char type)
{
/* Symbol names that exactly match to the following are ignored.*/
static const char * const ignored_symbols[] = {
/*
* Symbols which vary between passes. Passes 1 and 2 must have
Expand All @@ -104,6 +105,7 @@ static bool is_ignored_symbol(const char *name, char type)
NULL
};

/* Symbol names that begin with the following are ignored.*/
static const char * const ignored_prefixes[] = {
"$", /* local symbols for ARM, MIPS, etc. */
".LASANPC", /* s390 kasan local symbols */
Expand All @@ -113,16 +115,23 @@ static bool is_ignored_symbol(const char *name, char type)
NULL
};

/* Symbol names that end with the following are ignored.*/
static const char * const ignored_suffixes[] = {
"_from_arm", /* arm */
"_from_thumb", /* arm */
"_veneer", /* arm */
NULL
};

/* Symbol names that contain the following are ignored.*/
static const char * const ignored_matches[] = {
".long_branch.", /* ppc stub */
".plt_branch.", /* ppc stub */
NULL
};

const char * const *p;

/* Exclude symbols which vary between passes. */
for (p = ignored_symbols; *p; p++)
if (!strcmp(name, *p))
return true;
Expand All @@ -138,6 +147,11 @@ static bool is_ignored_symbol(const char *name, char type)
return true;
}

for (p = ignored_matches; *p; p++) {
if (strstr(name, *p))
return true;
}

if (type == 'U' || type == 'u')
return true;
/* exclude debugging symbols */
Expand Down

0 comments on commit 16bc1d5

Please sign in to comment.