aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/genksyms
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/genksyms')
-rw-r--r--scripts/genksyms/genksyms.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index 3a8297b5184c..f8bb4cabd62d 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -43,7 +43,7 @@ int cur_line = 1;
43char *cur_filename; 43char *cur_filename;
44 44
45static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types, 45static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types,
46 flag_preserve, flag_warnings; 46 flag_preserve, flag_warnings, flag_asm;
47static const char *arch = ""; 47static const char *arch = "";
48static const char *mod_prefix = ""; 48static const char *mod_prefix = "";
49 49
@@ -610,8 +610,11 @@ void export_symbol(const char *name)
610 if (flag_dump_defs) 610 if (flag_dump_defs)
611 fputs(">\n", debugfile); 611 fputs(">\n", debugfile);
612 612
613 /* Used as a linker script. */ 613 /* Used as assembly source or a linker script. */
614 printf("%s__crc_%s = 0x%08lx ;\n", mod_prefix, name, crc); 614 printf(flag_asm
615 ? ".equiv %s__crc_%s, %#08lx\n"
616 : "%s__crc_%s = %#08lx ;\n",
617 mod_prefix, name, crc);
615 } 618 }
616} 619}
617 620
@@ -648,9 +651,10 @@ void error_with_pos(const char *fmt, ...)
648 651
649static void genksyms_usage(void) 652static void genksyms_usage(void)
650{ 653{
651 fputs("Usage:\n" "genksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\n" "\n" 654 fputs("Usage:\n" "genksyms [-aAdDTwqhV] > /path/to/.tmp_obj.ver\n" "\n"
652#ifdef __GNU_LIBRARY__ 655#ifdef __GNU_LIBRARY__
653 " -a, --arch Select architecture\n" 656 " -a, --arch Select architecture\n"
657 " -A, --asm Generate assembly rather than linker script\n"
654 " -d, --debug Increment the debug level (repeatable)\n" 658 " -d, --debug Increment the debug level (repeatable)\n"
655 " -D, --dump Dump expanded symbol defs (for debugging only)\n" 659 " -D, --dump Dump expanded symbol defs (for debugging only)\n"
656 " -r, --reference file Read reference symbols from a file\n" 660 " -r, --reference file Read reference symbols from a file\n"
@@ -662,6 +666,7 @@ static void genksyms_usage(void)
662 " -V, --version Print the release version\n" 666 " -V, --version Print the release version\n"
663#else /* __GNU_LIBRARY__ */ 667#else /* __GNU_LIBRARY__ */
664 " -a Select architecture\n" 668 " -a Select architecture\n"
669 " -A Generate assembly rather than linker script\n"
665 " -d Increment the debug level (repeatable)\n" 670 " -d Increment the debug level (repeatable)\n"
666 " -D Dump expanded symbol defs (for debugging only)\n" 671 " -D Dump expanded symbol defs (for debugging only)\n"
667 " -r file Read reference symbols from a file\n" 672 " -r file Read reference symbols from a file\n"
@@ -683,6 +688,7 @@ int main(int argc, char **argv)
683#ifdef __GNU_LIBRARY__ 688#ifdef __GNU_LIBRARY__
684 struct option long_opts[] = { 689 struct option long_opts[] = {
685 {"arch", 1, 0, 'a'}, 690 {"arch", 1, 0, 'a'},
691 {"asm", 0, 0, 'A'},
686 {"debug", 0, 0, 'd'}, 692 {"debug", 0, 0, 'd'},
687 {"warnings", 0, 0, 'w'}, 693 {"warnings", 0, 0, 'w'},
688 {"quiet", 0, 0, 'q'}, 694 {"quiet", 0, 0, 'q'},
@@ -695,10 +701,10 @@ int main(int argc, char **argv)
695 {0, 0, 0, 0} 701 {0, 0, 0, 0}
696 }; 702 };
697 703
698 while ((o = getopt_long(argc, argv, "a:dwqVDr:T:ph", 704 while ((o = getopt_long(argc, argv, "a:dwqVADr:T:ph",
699 &long_opts[0], NULL)) != EOF) 705 &long_opts[0], NULL)) != EOF)
700#else /* __GNU_LIBRARY__ */ 706#else /* __GNU_LIBRARY__ */
701 while ((o = getopt(argc, argv, "a:dwqVDr:T:ph")) != EOF) 707 while ((o = getopt(argc, argv, "a:dwqVADr:T:ph")) != EOF)
702#endif /* __GNU_LIBRARY__ */ 708#endif /* __GNU_LIBRARY__ */
703 switch (o) { 709 switch (o) {
704 case 'a': 710 case 'a':
@@ -716,6 +722,9 @@ int main(int argc, char **argv)
716 case 'V': 722 case 'V':
717 fputs("genksyms version 2.5.60\n", stderr); 723 fputs("genksyms version 2.5.60\n", stderr);
718 break; 724 break;
725 case 'A':
726 flag_asm = 1;
727 break;
719 case 'D': 728 case 'D':
720 flag_dump_defs = 1; 729 flag_dump_defs = 1;
721 break; 730 break;