summaryrefslogtreecommitdiff
path: root/bfd/mmo.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-04-17 14:16:01 +0000
committerNick Clifton <nickc@redhat.com>2013-04-17 14:16:01 +0000
commita253d456e1c74d11503d31fe813da7eeeceed338 (patch)
treee687c9c4b67bec8a1b0f59a807b7edc71fe4269b /bfd/mmo.c
parent17310e568d81f53c2674062aefd38d29974ed7fd (diff)
* 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.
Diffstat (limited to 'bfd/mmo.c')
-rw-r--r--bfd/mmo.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/bfd/mmo.c b/bfd/mmo.c
index e336723138..cd7b0fc6af 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -1,6 +1,5 @@
/* 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.
@@ -662,8 +661,9 @@ mmo_decide_section (bfd *abfd, bfd_vma vma)
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))
@@ -676,8 +676,9 @@ mmo_decide_section (bfd *abfd, bfd_vma vma)
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))
@@ -692,8 +693,9 @@ mmo_decide_section (bfd *abfd, bfd_vma vma)
/* 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)