Skip to content

Commit 327df5b

Browse files
committed
kallsyms: squash output_address()
After commit 64e1660 ("kallsyms: get rid of code for absolute, kallsyms"), there is only one call site for output_address(). Squash it. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent ae70d70 commit 327df5b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

scripts/kallsyms.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,6 @@ static void output_label(const char *label)
292292
printf("%s:\n", label);
293293
}
294294

295-
/* Provide proper symbols relocatability by their '_text' relativeness. */
296-
static void output_address(unsigned long long addr)
297-
{
298-
if (_text <= addr)
299-
printf("\tPTR\t_text + %#llx\n", addr - _text);
300-
else
301-
printf("\tPTR\t_text - %#llx\n", _text - addr);
302-
}
303-
304295
/* uncompress a compressed symbol. When this function is called, the best table
305296
* might still be compressed itself, so the function needs to be recursive */
306297
static int expand_symbol(const unsigned char *data, int len, char *result)
@@ -488,7 +479,11 @@ static void write_src(void)
488479
printf("\n");
489480

490481
output_label("kallsyms_relative_base");
491-
output_address(relative_base);
482+
/* Provide proper symbols relocatability by their '_text' relativeness. */
483+
if (_text <= relative_base)
484+
printf("\tPTR\t_text + %#llx\n", relative_base - _text);
485+
else
486+
printf("\tPTR\t_text - %#llx\n", _text - relative_base);
492487
printf("\n");
493488

494489
sort_symbols_by_name();

0 commit comments

Comments
 (0)