Re: [PATCH 01/17] kallsyms: support big kernel symbols (2-byte lengths)

From
Gary Guo <gary@garyguo.net>
Date
2021-07-04 21:20:50
Also in
linux-kbuild, lkml, rust-for-linux
Reply to
Matthew Wilcox, 2021-07-04
On Sun, 4 Jul 2021 22:04:49 +0100
Matthew Wilcox [off-list ref] wrote:
On Sun, Jul 04, 2021 at 10:27:40PM +0200, ojeda@kernel.org wrote:
quoted
From: Miguel Ojeda <ojeda@kernel.org>

Rust symbols can become quite long due to namespacing introduced
by modules, types, traits, generics, etc.

Increasing to 255 is not enough in some cases, and therefore
we need to introduce 2-byte lengths to the symbol table. We call
these "big" symbols.

In order to avoid increasing all lengths to 2 bytes (since most
of them only require 1 byte, including many Rust ones), we use
length zero to mark "big" symbols in the table.  
What happened to my suggestion from last time of encoding symbols <
128 as 0-127 and symbols larger than that as (data[0] - 128) * 256 +
data[1]) ?
Yeah, I agree ULEB128 or similar encoding scheme would be better than
using 0 as an escape byte. If ULEB128 is used and we restrict number of
bytes to 2, it will encode numbers up to 2**14 instead of 2**16 like the
current scheme, but that should be sufficient anyway.

- Gary
Thread (64 messages) 64 messages, 16 authors, last reply 2021-07-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help