aboutsummaryrefslogtreecommitdiffstats
path: root/com32/tools
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-25 22:48:57 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-25 22:48:57 -0700
commitfa2276a1d307dd54521f96921bf64fdf62ac6a72 (patch)
tree1f92bb5a6c69be72603da5d346c60ea9ee56a315 /com32/tools
parent3fa0b06d47d4a361dffbc315ecfde515ee4524ac (diff)
downloadsyslinux-fa2276a1d307dd54521f96921bf64fdf62ac6a72.tar.gz
syslinux-fa2276a1d307dd54521f96921bf64fdf62ac6a72.tar.xz
syslinux-fa2276a1d307dd54521f96921bf64fdf62ac6a72.zip
relocs: handle R_386_NONE; better error messages
Handle R_386_NONE, which apparently can end up being generated by binutils in certain circumstances involving sections being removed completely. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/tools')
-rw-r--r--com32/tools/relocs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/com32/tools/relocs.c b/com32/tools/relocs.c
index 19eb6654..be57bf7e 100644
--- a/com32/tools/relocs.c
+++ b/com32/tools/relocs.c
@@ -155,10 +155,11 @@ static const char *rel_type(unsigned type)
REL_TYPE(R_386_GOTPC),
#undef REL_TYPE
};
- const char *name = "unknown type rel type name";
- if (type < ARRAY_SIZE(type_name)) {
+ const char *name = NULL;
+ if (type < ARRAY_SIZE(type_name))
name = type_name[type];
- }
+ if (!name)
+ name = "unknown";
return name;
}
@@ -532,6 +533,7 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym))
continue;
switch (r_type) {
+ case R_386_NONE:
case R_386_PC32:
case R_386_GOTPC:
case R_386_GOTOFF:
@@ -545,8 +547,8 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym))
visit(rel, sym);
break;
default:
- die("Unsupported relocation type: %d\n",
- r_type);
+ die("Unsupported relocation type: %s (%d)\n",
+ rel_type(r_type), r_type);
}
}
}