aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/genksyms/genksyms.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/genksyms/genksyms.c')
-rw-r--r--scripts/genksyms/genksyms.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index ef8822e59cda..da8ff4fa5001 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -32,7 +32,6 @@
32#endif /* __GNU_LIBRARY__ */ 32#endif /* __GNU_LIBRARY__ */
33 33
34#include "genksyms.h" 34#include "genksyms.h"
35#include "../mod/elfconfig.h"
36/*----------------------------------------------------------------------*/ 35/*----------------------------------------------------------------------*/
37 36
38#define HASH_BUCKETS 4096 37#define HASH_BUCKETS 4096
@@ -44,6 +43,8 @@ int cur_line = 1;
44char *cur_filename, *output_directory; 43char *cur_filename, *output_directory;
45 44
46int flag_debug, flag_dump_defs, flag_warnings; 45int flag_debug, flag_dump_defs, flag_warnings;
46const char *arch = "";
47const char *mod_prefix = "";
47 48
48static int errors; 49static int errors;
49static int nsyms; 50static int nsyms;
@@ -458,7 +459,7 @@ export_symbol(const char *name)
458 fputs(">\n", debugfile); 459 fputs(">\n", debugfile);
459 460
460 /* Used as a linker script. */ 461 /* Used as a linker script. */
461 printf("%s__crc_%s = 0x%08lx ;\n", MODULE_SYMBOL_PREFIX, name, crc); 462 printf("%s__crc_%s = 0x%08lx ;\n", mod_prefix, name, crc);
462 } 463 }
463} 464}
464 465
@@ -529,6 +530,7 @@ main(int argc, char **argv)
529 530
530#ifdef __GNU_LIBRARY__ 531#ifdef __GNU_LIBRARY__
531 struct option long_opts[] = { 532 struct option long_opts[] = {
533 {"arch", 1, 0, 'a'},
532 {"debug", 0, 0, 'd'}, 534 {"debug", 0, 0, 'd'},
533 {"warnings", 0, 0, 'w'}, 535 {"warnings", 0, 0, 'w'},
534 {"quiet", 0, 0, 'q'}, 536 {"quiet", 0, 0, 'q'},
@@ -538,13 +540,16 @@ main(int argc, char **argv)
538 {0, 0, 0, 0} 540 {0, 0, 0, 0}
539 }; 541 };
540 542
541 while ((o = getopt_long(argc, argv, "dwqVDk:p:", 543 while ((o = getopt_long(argc, argv, "a:dwqVDk:p:",
542 &long_opts[0], NULL)) != EOF) 544 &long_opts[0], NULL)) != EOF)
543#else /* __GNU_LIBRARY__ */ 545#else /* __GNU_LIBRARY__ */
544 while ((o = getopt(argc, argv, "dwqVDk:p:")) != EOF) 546 while ((o = getopt(argc, argv, "a:dwqVDk:p:")) != EOF)
545#endif /* __GNU_LIBRARY__ */ 547#endif /* __GNU_LIBRARY__ */
546 switch (o) 548 switch (o)
547 { 549 {
550 case 'a':
551 arch = optarg;
552 break;
548 case 'd': 553 case 'd':
549 flag_debug++; 554 flag_debug++;
550 break; 555 break;
@@ -567,7 +572,9 @@ main(int argc, char **argv)
567 genksyms_usage(); 572 genksyms_usage();
568 return 1; 573 return 1;
569 } 574 }
570 575 if ((strcmp(arch, "v850") == 0) ||
576 (strcmp(arch, "h8300") == 0))
577 mod_prefix = "_";
571 { 578 {
572 extern int yydebug; 579 extern int yydebug;
573 extern int yy_flex_debug; 580 extern int yy_flex_debug;