From 063a0e40ab792c926b5aba5a3267e20f3f4079f3 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Thu, 12 Mar 2009 17:38:05 +0100 Subject: [PATCH] dwarflint: Be more descriptive about error in relocation type --- src/dwarflint.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/dwarflint.c b/src/dwarflint.c index 45ab8dc88..5ae3e19b5 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -4526,8 +4526,9 @@ check_loc_or_range_structural (struct section_data *data, return retval; } -GElf_Rela *get_rel_or_rela (Elf_Data *data, int ndx, - GElf_Rela *dst, size_t type) +static GElf_Rela * +get_rel_or_rela (Elf_Data *data, int ndx, + GElf_Rela *dst, size_t type) { if (type == SHT_RELA) return gelf_getrela (data, ndx, dst); @@ -4608,12 +4609,23 @@ read_rel (struct section_data *secdata, Elf_Data *reldata, bool elf_64) /* Technically legal, but never used. Better have dwarflint flag them as erroneous, because it's more likely these are a result of a bug than actually being used. */ - wr_error (&where, ": 8 or 16-bit relocation type %d.\n", type); - goto skip; + { + char buf[64]; + wr_error (&where, ": 8 or 16-bit relocation type %s.\n", + ebl_reloc_type_name (secdata->file->ebl, + cur->type, buf, sizeof (buf))); + goto skip; + } default: - wr_error (&where, ": invalid relocation type %d.\n", type); - goto skip; + { + char buf[64]; + wr_error (&where, ": invalid relocation %d (%s).\n", + cur->type, + ebl_reloc_type_name (secdata->file->ebl, + cur->type, buf, sizeof (buf))); + goto skip; + } }; if (cur->offset + width >= secdata->data->d_size) -- 2.47.2