From d5d9682064556a84e70576d2a113d87b39507ed4 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 8 Apr 2009 14:53:28 +0200 Subject: [PATCH] dwarflint: Better message when relocation is formed against unexpected section --- src/dwarflint.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dwarflint.c b/src/dwarflint.c index a751eb0a7..c6e793c45 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -686,6 +686,7 @@ struct sec { enum section_id id; GElf_Shdr shdr; + const char *name; }; struct elf_file @@ -1199,6 +1200,7 @@ process_file (Dwarf *dwarf, const char *fname, bool only_one) struct secinfo *secentry = find_secentry (scnname); struct section_data *secdata = secentry != NULL ? secentry->dataptr : NULL; cursec->id = secentry != NULL ? secentry->sec : sec_invalid; + cursec->name = scnname; if (secdata != NULL) { @@ -2716,12 +2718,12 @@ relocate_one (struct relocation_data *reloc, struct relocation *rel, else if ((id = reloc->file->sec[section_index].id) != offset_into) { char *wh1 = id != sec_invalid - ? strdup (where_fmt (&WHERE (id, NULL), NULL)) : "(?)"; + ? strdup (where_fmt (&WHERE (id, NULL), NULL)) + : (char *)reloc->file->sec[section_index].name; char *wh2 = strdup (where_fmt (&WHERE (offset_into, NULL), NULL)); wr_error (&reloc_where, - ": relocation references section %s, but %s was expected" - " (section index: %" PRId64 ").\n", - wh1, wh2, section_index); + ": relocation references section %s, but %s was expected.\n", + wh1, wh2); free (wh2); if (id != sec_invalid) free (wh1); -- 2.47.2