aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/modpost.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-02-06 15:51:18 -0500
committerSam Ravnborg <sam@ravnborg.org>2008-02-09 04:43:58 -0500
commitf666751a0ab1d1671855da7e98889256b9a5b1bb (patch)
treede79e009161fd940feb583af0536306ad5e2b79f /scripts/mod/modpost.c
parentb1d0e4f535e10775cffde922208b49629169aeaa (diff)
kbuild/modpost: improve warnings if symbol is unknown
If we cannot determine the symbol then print (unknown) to hint the reader that we failed to find the symbol. This happens with REL relocation records in arm object files. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r--scripts/mod/modpost.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5d546466e6b1..32e9d8ffceef 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -613,7 +613,7 @@ static const char *sym_name(struct elf_info *elf, Elf_Sym *sym)
613 if (sym) 613 if (sym)
614 return elf->strtab + sym->st_name; 614 return elf->strtab + sym->st_name;
615 else 615 else
616 return ""; 616 return "(unknown)";
617} 617}
618 618
619static const char *sec_name(struct elf_info *elf, int shndx) 619static const char *sec_name(struct elf_info *elf, int shndx)
@@ -1102,7 +1102,7 @@ static int is_function(Elf_Sym *sym)
1102 if (sym) 1102 if (sym)
1103 return ELF_ST_TYPE(sym->st_info) == STT_FUNC; 1103 return ELF_ST_TYPE(sym->st_info) == STT_FUNC;
1104 else 1104 else
1105 return 0; 1105 return -1;
1106} 1106}
1107 1107
1108/* 1108/*
@@ -1120,10 +1120,17 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
1120{ 1120{
1121 const char *from, *from_p; 1121 const char *from, *from_p;
1122 const char *to, *to_p; 1122 const char *to, *to_p;
1123 from = from_is_func ? "function" : "variable"; 1123
1124 from_p = from_is_func ? "()" : ""; 1124 switch (from_is_func) {
1125 to = to_is_func ? "function" : "variable"; 1125 case 0: from = "variable"; from_p = ""; break;
1126 to_p = to_is_func ? "()" : ""; 1126 case 1: from = "function"; from_p = "()"; break;
1127 default: from = "(unknown reference)"; from_p = ""; break;
1128 }
1129 switch (to_is_func) {
1130 case 0: to = "variable"; to_p = ""; break;
1131 case 1: to = "function"; to_p = "()"; break;
1132 default: to = "(unknown reference)"; to_p = ""; break;
1133 }
1127 1134
1128 sec_mismatch_count++; 1135 sec_mismatch_count++;
1129 if (!sec_mismatch_verbose) 1136 if (!sec_mismatch_verbose)
@@ -1137,7 +1144,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
1137 switch (mismatch) { 1144 switch (mismatch) {
1138 case TEXT_TO_INIT: 1145 case TEXT_TO_INIT:
1139 fprintf(stderr, 1146 fprintf(stderr,
1140 "The function %s %s() references\n" 1147 "The function %s%s() references\n"
1141 "the %s %s%s%s.\n" 1148 "the %s %s%s%s.\n"
1142 "This is often because %s lacks a %s\n" 1149 "This is often because %s lacks a %s\n"
1143 "annotation or the annotation of %s is wrong.\n", 1150 "annotation or the annotation of %s is wrong.\n",