Go to file
Zhen Lei 010a0aad39 kallsyms: Correctly sequence symbols when CONFIG_LTO_CLANG=y
LLVM appends various suffixes for local functions and variables, suffixes
observed:
 - foo.llvm.[0-9a-f]+
 - foo.[0-9a-f]+

Therefore, when CONFIG_LTO_CLANG=y, kallsyms_lookup_name() needs to
truncate the suffix of the symbol name before comparing the local function
or variable name.

Old implementation code:
-	if (strcmp(namebuf, name) == 0)
-		return kallsyms_sym_address(i);
-	if (cleanup_symbol_name(namebuf) && strcmp(namebuf, name) == 0)
-		return kallsyms_sym_address(i);

The preceding process is traversed by address from low to high. That is,
for those with the same name after the suffix is removed, the one with
the smallest address is returned first. Therefore, when sorting in the
tool, if the raw names are the same, they should be sorted by address in
ascending order.

ASCII[.]   = 2e
ASCII[0-9] = 30,39
ASCII[A-Z] = 41,5a
ASCII[_]   = 5f
ASCII[a-z] = 61,7a

According to the preceding ASCII code values, the following sorting result
is strictly followed.
 ---------------------------------
|    main-key     |    sub-key    |
|---------------------------------|
|                 |  addr_lowest  |
| <name>          |      ...      |
| <name>.<suffix> |      ...      |
|                 |  addr_highest |
|---------------------------------|
| <name>?<others> |               |   //? is [_A-Za-z0-9]
 ---------------------------------

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2022-11-12 18:47:36 -08:00
Documentation s390: 2022-11-11 09:32:57 -08:00
LICENSES
arch RISC-V Fixes for 6.1-rc5 2022-11-11 09:40:19 -08:00
block
certs
crypto
drivers hyperv-fixes for v6.1-rc5 2022-11-11 09:24:03 -08:00
fs for-6.1-rc4-tag 2022-11-10 08:58:29 -08:00
include module: remove redundant module_sysfs_initialized variable 2022-11-11 10:19:52 -08:00
init
io_uring
ipc
kernel kallsyms: Improve the performance of kallsyms_lookup_name() 2022-11-12 18:47:36 -08:00
lib
mm
net
rust
samples
scripts kallsyms: Correctly sequence symbols when CONFIG_LTO_CLANG=y 2022-11-12 18:47:36 -08:00
security
sound
tools perf tools fixes for v6.1: 2nd batch 2022-11-11 09:45:30 -08:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS MAINTAINERS: Move Vivien to CREDITS 2022-11-10 13:53:53 -08:00
Kbuild
Kconfig
MAINTAINERS hyperv-fixes for v6.1-rc5 2022-11-11 09:24:03 -08:00
Makefile
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.