File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ static char kallsyms_get_symbol_type(unsigned int off)
135135static unsigned int get_symbol_offset (unsigned long pos )
136136{
137137 const u8 * name ;
138- int i ;
138+ int i , len ;
139139
140140 /*
141141 * Use the closest marker we have. We have markers every 256 positions,
@@ -149,8 +149,18 @@ static unsigned int get_symbol_offset(unsigned long pos)
149149 * so we just need to add the len to the current pointer for every
150150 * symbol we wish to skip.
151151 */
152- for (i = 0 ; i < (pos & 0xFF ); i ++ )
153- name = name + (* name ) + 1 ;
152+ for (i = 0 ; i < (pos & 0xFF ); i ++ ) {
153+ len = * name ;
154+
155+ /*
156+ * If MSB is 1, it is a "big" symbol, so we need to look into
157+ * the next byte (and skip it, too).
158+ */
159+ if ((len & 0x80 ) != 0 )
160+ len = ((len & 0x7F ) | (name [1 ] << 7 )) + 1 ;
161+
162+ name = name + len + 1 ;
163+ }
154164
155165 return name - kallsyms_names ;
156166}
You can’t perform that action at this time.
0 commit comments