Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f666751a0ab1d1671855da7e98889256b9a5b1bb
Commit:     f666751a0ab1d1671855da7e98889256b9a5b1bb
Parent:     b1d0e4f535e10775cffde922208b49629169aeaa
Author:     Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 21:51:18 2008 +0100
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Sat Feb 9 10:43:58 2008 +0100

    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 <[EMAIL PROTECTED]>
---
 scripts/mod/modpost.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5d54646..32e9d8f 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)
        if (sym)
                return elf->strtab + sym->st_name;
        else
-               return "";
+               return "(unknown)";
 }
 
 static const char *sec_name(struct elf_info *elf, int shndx)
@@ -1102,7 +1102,7 @@ static int is_function(Elf_Sym *sym)
        if (sym)
                return ELF_ST_TYPE(sym->st_info) == STT_FUNC;
        else
-               return 0;
+               return -1;
 }
 
 /*
@@ -1120,10 +1120,17 @@ static void report_sec_mismatch(const char *modname, 
enum mismatch mismatch,
 {
        const char *from, *from_p;
        const char *to, *to_p;
-       from = from_is_func ? "function" : "variable";
-       from_p = from_is_func ? "()" : "";
-       to = to_is_func ? "function" : "variable";
-       to_p = to_is_func ? "()" : "";
+
+       switch (from_is_func) {
+       case 0: from = "variable"; from_p = "";   break;
+       case 1: from = "function"; from_p = "()"; break;
+       default: from = "(unknown reference)"; from_p = ""; break;
+       }
+       switch (to_is_func) {
+       case 0: to = "variable"; to_p = "";   break;
+       case 1: to = "function"; to_p = "()"; break;
+       default: to = "(unknown reference)"; to_p = ""; break;
+       }
 
        sec_mismatch_count++;
        if (!sec_mismatch_verbose)
@@ -1137,7 +1144,7 @@ static void report_sec_mismatch(const char *modname, enum 
mismatch mismatch,
        switch (mismatch) {
        case TEXT_TO_INIT:
                fprintf(stderr,
-               "The function %s %s() references\n"
+               "The function %s%s() references\n"
                "the %s %s%s%s.\n"
                "This is often because %s lacks a %s\n"
                "annotation or the annotation of %s is wrong.\n",
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to