mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
PR24871, readelf segv in dump_ia64_unwind
PR 24871 * readelf.c (ABSADDR): Delete. (dump_ia64_unwind): Expand ABSADDR. Check validity of info.section.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2019-08-02 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 24871
|
||||||
|
* readelf.c (ABSADDR): Delete.
|
||||||
|
(dump_ia64_unwind): Expand ABSADDR. Check validity of info.section.
|
||||||
|
|
||||||
2019-07-29 Martin Liska <mliska@suse.cz>
|
2019-07-29 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
PR 24768
|
PR 24768
|
||||||
|
@ -7415,11 +7415,6 @@ struct absaddr
|
|||||||
bfd_vma offset;
|
bfd_vma offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ABSADDR(a) \
|
|
||||||
((a).section \
|
|
||||||
? filedata->section_headers [(a).section].sh_addr + (a).offset \
|
|
||||||
: (a).offset)
|
|
||||||
|
|
||||||
/* Find the nearest symbol at or below ADDR. Returns the symbol
|
/* Find the nearest symbol at or below ADDR. Returns the symbol
|
||||||
name, if found, and the offset from the symbol to ADDR. */
|
name, if found, and the offset from the symbol to ADDR. */
|
||||||
|
|
||||||
@ -7565,8 +7560,21 @@ dump_ia64_unwind (Filedata * filedata, struct ia64_unw_aux_info * aux)
|
|||||||
if (aux->info == NULL)
|
if (aux->info == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
offset = tp->info.offset;
|
||||||
|
if (tp->info.section)
|
||||||
|
{
|
||||||
|
if (tp->info.section >= filedata->file_header.e_shnum)
|
||||||
|
{
|
||||||
|
warn (_("Invalid section %u in table entry %ld\n"),
|
||||||
|
tp->info.section, (long) (tp - aux->table));
|
||||||
|
res = FALSE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
offset += filedata->section_headers[tp->info.section].sh_addr;
|
||||||
|
}
|
||||||
|
offset -= aux->info_addr;
|
||||||
/* PR 17531: file: 0997b4d1. */
|
/* PR 17531: file: 0997b4d1. */
|
||||||
if ((ABSADDR (tp->info) - aux->info_addr) >= aux->info_size)
|
if (offset >= aux->info_size)
|
||||||
{
|
{
|
||||||
warn (_("Invalid offset %lx in table entry %ld\n"),
|
warn (_("Invalid offset %lx in table entry %ld\n"),
|
||||||
(long) tp->info.offset, (long) (tp - aux->table));
|
(long) tp->info.offset, (long) (tp - aux->table));
|
||||||
@ -7574,7 +7582,7 @@ dump_ia64_unwind (Filedata * filedata, struct ia64_unw_aux_info * aux)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
head = aux->info + (ABSADDR (tp->info) - aux->info_addr);
|
head = aux->info + offset;
|
||||||
stamp = byte_get ((unsigned char *) head, sizeof (stamp));
|
stamp = byte_get ((unsigned char *) head, sizeof (stamp));
|
||||||
|
|
||||||
printf (" v%u, flags=0x%lx (%s%s), len=%lu bytes\n",
|
printf (" v%u, flags=0x%lx (%s%s), len=%lu bytes\n",
|
||||||
|
Reference in New Issue
Block a user