Skip to content

Commit

Permalink
modpost: Skip .llvm.call-graph-profile section check
Browse files Browse the repository at this point in the history
.llvm.call-graph-profile section is added by clang when the kernel is
built with profiles (e.g. -fprofile-sample-use= or -fprofile-use=).
Note that .llvm.call-graph-profile intentionally uses REL relocations
to decrease the object size, for more details see
https://reviews.llvm.org/D104080.

The section contains edge information derived from text sections,
so .llvm.call-graph-profile itself doesn't need more analysis as
the text sections have been analyzed.

This change fixes the kernel build with clang and a sample profile
which currently fails with:

"FATAL: modpost: Please add code to calculate addend for this architecture"

Signed-off-by: Denis Nikitin <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Reviewed-by: Fangrui Song <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
Denis Nikitin authored and masahir0y committed Sep 1, 2023
1 parent 151aeca commit 1ef061a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ static const char *const section_white_list[] =
".fmt_slot*", /* EZchip */
".gnu.lto*",
".discard.*",
".llvm.call-graph-profile", /* call graph */
NULL
};

Expand Down

0 comments on commit 1ef061a

Please sign in to comment.