mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-01 08:54:44 +08:00
PR22127, as segfaults assembling invalid .reloc
"sec" gets set to NULL on errors in the offset expression. This patch disables part of the reloc expression processing that needs "sec" valid. I didn't disable the entire reloc expression handling so that errors in the reloc expression are reported even when the offset expression has an error. PR 22127 * write.c (resolve_reloc_expr_symbols): Don't segfault when sec has been set to NULL.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2017-09-14 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 22127
|
||||||
|
* write.c (resolve_reloc_expr_symbols): Don't segfault when
|
||||||
|
sec has been set to NULL.
|
||||||
|
|
||||||
2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
|
2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* config/tc-i386.c (NOTRACK_PREFIX): Removed.
|
* config/tc-i386.c (NOTRACK_PREFIX): Removed.
|
||||||
|
@ -724,7 +724,7 @@ resolve_reloc_expr_symbols (void)
|
|||||||
as_bad_where (r->file, r->line, _("invalid reloc expression"));
|
as_bad_where (r->file, r->line, _("invalid reloc expression"));
|
||||||
sec = NULL;
|
sec = NULL;
|
||||||
}
|
}
|
||||||
else if (sym != NULL)
|
else if (sym != NULL && sec != NULL)
|
||||||
{
|
{
|
||||||
/* Convert relocs against local symbols to refer to the
|
/* Convert relocs against local symbols to refer to the
|
||||||
corresponding section symbol plus offset instead. Keep
|
corresponding section symbol plus offset instead. Keep
|
||||||
|
Reference in New Issue
Block a user