macro's return value is ignored.
* elf32-hppa.c: Likewise.
* elf32-tic6x.c: Likewise.
* mach-o.c: Likewise.
* mmo.c: Likewise.
* opncls.c: Likewise.
* peicode.h: Likewise.
* elf32-m32r.c: Check return value of bfd_set_section_*().
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* vms-alpha.c: Likewise.
+2013-04-17 Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
+
+ * coffcode.h: Added a cast to void when a bfd_set_section_*()
+ macro's return value is ignored.
+ * elf32-hppa.c: Likewise.
+ * elf32-tic6x.c: Likewise.
+ * mach-o.c: Likewise.
+ * mmo.c: Likewise.
+ * opncls.c: Likewise.
+ * peicode.h: Likewise.
+ * elf32-m32r.c: Check return value of bfd_set_section_*().
+ * elfnn-ia64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * vms-alpha.c: Likewise.
+
2013-04-15 H.J. Lu <hongjiu.lu@intel.com>
PR ld/15371
/* Support for the generic parts of most COFF variants, for BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright 1990-2013 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
incremented in coff_set_section_contents. This is right for
SVR3.2. */
if (strcmp (current->name, _LIB) == 0)
- bfd_set_section_vma (abfd, current, 0);
+ (void) bfd_set_section_vma (abfd, current, 0);
#endif
#ifdef ALIGN_SECTIONS_IN_FILE
strm.next_in = (Bytef*) compressed_buffer + 12;
strm.avail_out = uncompressed_size;
+ BFD_ASSERT (Z_OK == 0);
rc = inflateInit (&strm);
while (strm.avail_in > 0 && strm.avail_out > 0)
{
if (rc != Z_OK)
- return FALSE;
+ break;
strm.next_out = ((Bytef*) uncompressed_buffer
+ (uncompressed_size - strm.avail_out));
rc = inflate (&strm, Z_FINISH);
if (rc != Z_STREAM_END)
- return FALSE;
+ break;
rc = inflateReset (&strm);
}
- rc = inflateEnd (&strm);
+ rc |= inflateEnd (&strm);
return rc == Z_OK && strm.avail_out == 0;
}
#endif
/* BFD back-end for HP PA-RISC ELF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright 1990-2013 Free Software Foundation, Inc.
Original code by
Center for Software Science
bfd_size_type mask;
if (gotalign > pltalign)
- bfd_set_section_alignment (dynobj, sec, gotalign);
+ (void) bfd_set_section_alignment (dynobj, sec, gotalign);
mask = ((bfd_size_type) 1 << gotalign) - 1;
sec->size = (sec->size + sizeof (plt_stub) + mask) & ~mask;
}
/* M32R-specific support for 32-bit ELF.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright 1996-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
flags);
if (s == NULL)
return FALSE;
- bfd_set_section_alignment (abfd, s, 2);
+ if (! bfd_set_section_alignment (abfd, s, 2))
+ return FALSE;
}
bh = bfd_link_hash_lookup (info->hash, "_SDA_BASE_",
/* 32-bit ELF support for TI C6X
- Copyright 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright 2010-2013 Free Software Foundation, Inc.
Contributed by Joseph Myers <joseph@codesourcery.com>
Bernd Schmidt <bernds@codesourcery.com>
*secp = bfd_make_section_old_way (abfd, ".scommon");
(*secp)->flags |= SEC_IS_COMMON;
*valp = sym->st_size;
- bfd_set_section_alignment (abfd, *secp, bfd_log2 (sym->st_value));
+ (void) bfd_set_section_alignment (abfd, *secp, bfd_log2 (sym->st_value));
break;
}
/* IA-64 support for 64-bit ELF
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright 1998-2013 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library.
bfd_set_section_flags (abfd, ia64_info->root.sgot,
SEC_SMALL_DATA | flags);
/* The .got section is always aligned at 8 bytes. */
- bfd_set_section_alignment (abfd, ia64_info->root.sgot, 3);
+ if (! bfd_set_section_alignment (abfd, ia64_info->root.sgot, 3))
+ return FALSE;
}
if (!get_pltoff (abfd, info, ia64_info))
if (!dynobj)
ia64_info->root.dynobj = dynobj = abfd;
if (!_bfd_elf_create_got_section (dynobj, info))
- return 0;
+ return NULL;
got = ia64_info->root.sgot;
/* The .got section is always aligned at 8 bytes. */
if (!bfd_set_section_alignment (abfd, got, 3))
- return 0;
+ return NULL;
flags = bfd_get_section_flags (abfd, got);
- bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags);
+ if (! bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags))
+ return NULL;
}
return got;
/* MIPS-specific support for ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
- Free Software Foundation, Inc.
+ Copyright 1993-2013 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
/* Change alignments of some sections. */
s = bfd_get_linker_section (abfd, ".hash");
if (s != NULL)
- bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+
s = bfd_get_linker_section (abfd, ".dynsym");
if (s != NULL)
- bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+
s = bfd_get_linker_section (abfd, ".dynstr");
if (s != NULL)
- bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+
/* ??? */
s = bfd_get_section_by_name (abfd, ".reginfo");
if (s != NULL)
- bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+
s = bfd_get_linker_section (abfd, ".dynamic");
if (s != NULL)
- bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
}
if (!info->shared)
\f
/* Structure for saying that BFD machine EXTENSION extends BASE. */
-struct mips_mach_extension {
+struct mips_mach_extension
+{
unsigned long extension, base;
};
/* An array describing how BFD machines relate to one another. The entries
are ordered topologically with MIPS I extensions listed last. */
-static const struct mips_mach_extension mips_mach_extensions[] = {
+static const struct mips_mach_extension mips_mach_extensions[] =
+{
/* MIPS64r2 extensions. */
{ bfd_mach_mips_octeon2, bfd_mach_mips_octeonp },
{ bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
/* Mach-O support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright 1999-2013 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
s->flags = xlat->macho_sectype | xlat->macho_secattr;
s->align = xlat->sectalign > bfdalign ? xlat->sectalign
: bfdalign;
- bfd_set_section_alignment (abfd, sec, s->align);
+ (void) bfd_set_section_alignment (abfd, sec, s->align);
bfd_flags = bfd_get_section_flags (abfd, sec);
if (bfd_flags == SEC_NO_FLAGS)
bfd_set_section_flags (abfd, sec, xlat->bfd_flags);
/* BFD back-end for mmo objects (MMIX-specific object-format).
- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright 2001-2013 Free Software Foundation, Inc.
Written by Hans-Peter Nilsson (hp@bitrange.com).
Infrastructure and other bits originally copied from srec.c and
binary.c.
if (sec == NULL)
return NULL;
- if (! sec->user_set_vma)
- bfd_set_section_vma (abfd, sec, vma);
+ if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+ return NULL;
+
if (! bfd_set_section_flags (abfd, sec,
bfd_get_section_flags (abfd, sec)
| SEC_CODE | SEC_LOAD | SEC_ALLOC))
if (sec == NULL)
return NULL;
- if (! sec->user_set_vma)
- bfd_set_section_vma (abfd, sec, vma);
+ if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+ return NULL;
+
if (! bfd_set_section_flags (abfd, sec,
bfd_get_section_flags (abfd, sec)
| SEC_LOAD | SEC_ALLOC))
/* If there's still no suitable section, make a new one. */
sprintf (sec_name, ".MMIX.sec.%d", abfd->tdata.mmo_data->sec_no++);
sec = mmo_make_section (abfd, sec_name);
- if (! sec->user_set_vma)
- bfd_set_section_vma (abfd, sec, vma);
+
+ if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+ return NULL;
if (! bfd_set_section_flags (abfd, sec,
bfd_get_section_flags (abfd, sec)
/* opncls.c -- open and close a BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013
- Free Software Foundation, Inc.
+ Copyright 1990-2013 Free Software Foundation, Inc.
Written by Cygnus Support.
return NULL;
}
nbfd->opened_once = TRUE;
+
/* If we opened the file by name, mark it cacheable; we can close it
and reopen it later. However, if a file descriptor was provided,
then it may have been opened with special flags that make it
unsafe to close and reopen the file. */
if (fd == -1)
- bfd_set_cacheable (nbfd, TRUE);
+ (void) bfd_set_cacheable (nbfd, TRUE);
return nbfd;
}
/* Support for the generic parts of PE/PEI, for BFD.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
- Free Software Foundation, Inc.
+ Copyright 1995-2013 Free Software Foundation, Inc.
Written by Cygnus Solutions.
This file is part of BFD, the Binary File Descriptor library.
bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
- bfd_set_section_alignment (vars->abfd, sec, 2);
+ (void) bfd_set_section_alignment (vars->abfd, sec, 2);
/* Check that we will not run out of space. */
BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
/* vms.c -- BFD back-end for EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright 1996-2013 Free Software Foundation, Inc.
Initial version written by Klaus Kaempf (kkaempf@rmi.de)
Major rewrite by Adacore.
vms_debug2 ((1, "vms_new_section_hook (%p, [%d]%s)\n",
abfd, section->index, section->name));
- bfd_set_section_alignment (abfd, section, 0);
+ if (! bfd_set_section_alignment (abfd, section, 0))
+ return FALSE;
vms_debug2 ((7, "%d: %s\n", section->index, section->name));