x86, relocs: When printing an error, say relative or absolute
[pandora-kernel.git] / arch / x86 / tools / relocs.c
index 2071bad..c075507 100644 (file)
@@ -55,7 +55,11 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
  * as absolute (typically defined outside any section in the linker script.)
  */
        [S_REL] =
-       "^_end$",
+       "^(__init_(begin|end)|"
+       "__x86_cpu_dev_(start|end)|"
+       "(__parainstructions|__alt_instructions)(|_end)|"
+       "(__iommu_table|__apicdrivers|__smp_locks)(|_end)|"
+       "_end)$"
 };
 
 
@@ -558,10 +562,14 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym),
                        Elf32_Sym *sym;
                        unsigned r_type;
                        const char *symname;
+                       int shn_abs;
+
                        rel = &sec->reltab[j];
                        sym = &sh_symtab[ELF32_R_SYM(rel->r_info)];
                        r_type = ELF32_R_TYPE(rel->r_info);
 
+                       shn_abs = sym->st_shndx == SHN_ABS;
+
                        switch (r_type) {
                        case R_386_NONE:
                        case R_386_PC32:
@@ -577,7 +585,7 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym),
                                symname = sym_name(sym_strtab, sym);
                                if (!use_real_mode)
                                        goto bad;
-                               if (sym->st_shndx == SHN_ABS) {
+                               if (shn_abs) {
                                        if (is_reloc(S_ABS, symname))
                                                break;
                                        else if (!is_reloc(S_SEG, symname))
@@ -593,7 +601,7 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym),
 
                        case R_386_32:
                                symname = sym_name(sym_strtab, sym);
-                               if (sym->st_shndx == SHN_ABS) {
+                               if (shn_abs) {
                                        if (is_reloc(S_ABS, symname))
                                                break;
                                        else if (!is_reloc(S_REL, symname))
@@ -611,7 +619,8 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym),
                                break;
                        bad:
                                symname = sym_name(sym_strtab, sym);
-                               die("Invalid %s relocation: %s\n",
+                               die("Invalid %s %s relocation: %s\n",
+                                   shn_abs ? "absolute" : "relative",
                                    rel_type(r_type), symname);
                        }
                }