Merge git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[powerpc.git] / scripts / kallsyms.c
index 4c1ad0a..8b809b2 100644 (file)
@@ -265,7 +265,7 @@ static void write_src(void)
        printf("#define ALGN .align 4\n");
        printf("#endif\n");
 
-       printf(".data\n");
+       printf("\t.section .rodata, \"a\"\n");
 
        /* Provide proper symbols relocatability by their '_text'
         * relativeness.  The symbol names cannot be used to construct
@@ -277,8 +277,12 @@ static void write_src(void)
        output_label("kallsyms_addresses");
        for (i = 0; i < table_cnt; i++) {
                if (toupper(table[i].sym[0]) != 'A') {
-                       printf("\tPTR\t_text + %#llx\n",
-                               table[i].addr - _text);
+                       if (_text <= table[i].addr)
+                               printf("\tPTR\t_text + %#llx\n",
+                                       table[i].addr - _text);
+                       else
+                               printf("\tPTR\t_text - %#llx\n",
+                                       _text - table[i].addr);
                } else {
                        printf("\tPTR\t%#llx\n", table[i].addr);
                }