X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fsrconv.c;h=0d1dcd8b453dfb07c337a7507d05cbd1a5278d01;hb=9ef9e6a6a0dd8f948708cb67c9afcfd0be40cb0a;hp=63c6940e36cd7f8f72ff47881116f408cef9f17c;hpb=86eafac0aad7edbc1ccea6daf53480a36339250a;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/srconv.c b/binutils/srconv.c index 63c6940e36..0d1dcd8b45 100644 --- a/binutils/srconv.c +++ b/binutils/srconv.c @@ -1,5 +1,5 @@ /* srconv.c -- Sysroff conversion program - Copyright (C) 1994-2015 Free Software Foundation, Inc. + Copyright (C) 1994-2016 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -1204,6 +1204,8 @@ walk_tree_sfile (struct coff_section *section, struct coff_sfile *sfile) static void wr_program_structure (struct coff_ofile *p, struct coff_sfile *sfile) { + if (p->nsections < 4) + return; walk_tree_sfile (p->sections + 4, sfile); } @@ -1705,6 +1707,9 @@ prescan (struct coff_ofile *otree) struct coff_symbol *s; struct coff_section *common_section; + if (otree->nsections < 3) + return; + /* Find the common section - always section 3. */ common_section = otree->sections + 3; @@ -1715,7 +1720,6 @@ prescan (struct coff_ofile *otree) if (s->visible->type == coff_vis_common) { struct coff_where *w = s->where; - /* s->visible->type = coff_vis_ext_def; leave it as common */ common_section->size = align (common_section->size); w->offset = common_section->size + common_section->address;