return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_thread (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_thread_command *cmd = &command->command.thread;
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
|| bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
offset += cmd->flavours[i].size + sizeof (raw);
}
- return 0;
+ return TRUE;
}
long
return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_section_32 (bfd *abfd, bfd_mach_o_section *section)
{
struct mach_o_section_32_external raw;
if (bfd_bwrite (&raw, BFD_MACH_O_SECTION_SIZE, abfd)
!= BFD_MACH_O_SECTION_SIZE)
- return -1;
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_section_64 (bfd *abfd, bfd_mach_o_section *section)
{
struct mach_o_section_64_external raw;
if (bfd_bwrite (&raw, BFD_MACH_O_SECTION_64_SIZE, abfd)
!= BFD_MACH_O_SECTION_64_SIZE)
- return -1;
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_segment_32 (bfd *abfd, bfd_mach_o_load_command *command)
{
struct mach_o_segment_command_32_external raw;
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
if (!bfd_mach_o_write_relocs (abfd, sec))
- return -1;
+ return FALSE;
memcpy (raw.segname, seg->segname, 16);
bfd_h_put_32 (abfd, seg->vmaddr, raw.vmaddr);
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
- if (bfd_mach_o_write_section_32 (abfd, sec))
- return -1;
+ if (!bfd_mach_o_write_section_32 (abfd, sec))
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_write_segment_64 (bfd *abfd, bfd_mach_o_load_command *command)
{
struct mach_o_segment_command_64_external raw;
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
if (!bfd_mach_o_write_relocs (abfd, sec))
- return -1;
+ return FALSE;
memcpy (raw.segname, seg->segname, 16);
bfd_h_put_64 (abfd, seg->vmaddr, raw.vmaddr);
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
- if (bfd_mach_o_write_section_64 (abfd, sec))
- return -1;
+ if (!bfd_mach_o_write_section_64 (abfd, sec))
+ return FALSE;
- return 0;
+ return TRUE;
}
static bfd_boolean
switch (cur->type)
{
case BFD_MACH_O_LC_SEGMENT:
- if (bfd_mach_o_write_segment_32 (abfd, cur) != 0)
+ if (!bfd_mach_o_write_segment_32 (abfd, cur))
return FALSE;
break;
case BFD_MACH_O_LC_SEGMENT_64:
- if (bfd_mach_o_write_segment_64 (abfd, cur) != 0)
+ if (!bfd_mach_o_write_segment_64 (abfd, cur))
return FALSE;
break;
case BFD_MACH_O_LC_SYMTAB:
break;
case BFD_MACH_O_LC_THREAD:
case BFD_MACH_O_LC_UNIXTHREAD:
- if (bfd_mach_o_write_thread (abfd, cur) != 0)
+ if (!bfd_mach_o_write_thread (abfd, cur))
return FALSE;
break;
case BFD_MACH_O_LC_LOADFVMLIB:
}
}
-static int
+static bfd_boolean
bfd_mach_o_read_dylinker (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dylinker_command *cmd = &command->command.dylinker;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
nameoff = bfd_h_get_32 (abfd, raw.str);
cmd->name_len = command->len - nameoff;
cmd->name_str = bfd_alloc (abfd, cmd->name_len);
if (cmd->name_str == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->name_offset, SEEK_SET) != 0
|| bfd_bread (cmd->name_str, cmd->name_len, abfd) != cmd->name_len)
- return -1;
- return 0;
+ return FALSE;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_dylib (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dylib_command *cmd = &command->command.dylib;
break;
default:
BFD_FAIL ();
- return -1;
+ return FALSE;
}
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
nameoff = bfd_h_get_32 (abfd, raw.name);
cmd->timestamp = bfd_h_get_32 (abfd, raw.timestamp);
cmd->name_len = command->len - nameoff;
cmd->name_str = bfd_alloc (abfd, cmd->name_len);
if (cmd->name_str == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->name_offset, SEEK_SET) != 0
|| bfd_bread (cmd->name_str, cmd->name_len, abfd) != cmd->name_len)
- return -1;
- return 0;
+ return FALSE;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_prebound_dylib (bfd *abfd,
bfd_mach_o_load_command *command)
{
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
nameoff = bfd_h_get_32 (abfd, raw.name);
modoff = bfd_h_get_32 (abfd, raw.linked_modules);
if (nameoff > command->len || modoff > command->len)
- return -1;
+ return FALSE;
str_len = command->len - sizeof (raw);
str = bfd_alloc (abfd, str_len);
if (str == NULL)
- return -1;
+ return FALSE;
if (bfd_bread (str, str_len, abfd) != str_len)
- return -1;
+ return FALSE;
cmd->name_offset = command->offset + nameoff;
cmd->nmodules = bfd_h_get_32 (abfd, raw.nmodules);
cmd->name_str = (char *)str + nameoff - (sizeof (raw) + BFD_MACH_O_LC_SIZE);
cmd->linked_modules = str + modoff - (sizeof (raw) + BFD_MACH_O_LC_SIZE);
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_prebind_cksum (bfd *abfd,
bfd_mach_o_load_command *command)
{
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->cksum = bfd_get_32 (abfd, raw.cksum);
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_twolevel_hints (bfd *abfd,
bfd_mach_o_load_command *command)
{
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->offset = bfd_get_32 (abfd, raw.offset);
cmd->nhints = bfd_get_32 (abfd, raw.nhints);
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_fvmlib (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_fvmlib_command *fvm = &command->command.fvmlib;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
nameoff = bfd_h_get_32 (abfd, raw.name);
fvm->minor_version = bfd_h_get_32 (abfd, raw.minor_version);
fvm->name_len = command->len - nameoff;
fvm->name_str = bfd_alloc (abfd, fvm->name_len);
if (fvm->name_str == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, fvm->name_offset, SEEK_SET) != 0
|| bfd_bread (fvm->name_str, fvm->name_len, abfd) != fvm->name_len)
- return -1;
- return 0;
+ return FALSE;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_thread (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
struct mach_o_thread_command_external raw;
if (offset >= command->len)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
offset += sizeof (raw) + bfd_h_get_32 (abfd, raw.count) * 4;
nflavours++;
cmd->flavours = bfd_alloc
(abfd, nflavours * sizeof (bfd_mach_o_thread_flavour));
if (cmd->flavours == NULL)
- return -1;
+ return FALSE;
cmd->nflavours = nflavours;
offset = 8;
struct mach_o_thread_command_external raw;
if (offset >= command->len)
- return -1;
+ return FALSE;
if (nflavours >= cmd->nflavours)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->flavours[nflavours].flavour = bfd_h_get_32 (abfd, raw.flavour);
cmd->flavours[nflavours].offset = command->offset + offset + sizeof (raw);
snamelen = strlen (prefix) + 1 + 20 + 1 + strlen (flavourstr) + 1;
sname = bfd_alloc (abfd, snamelen);
if (sname == NULL)
- return -1;
+ return FALSE;
for (;;)
{
cmd->section = bfdsec;
}
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_dysymtab (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dysymtab_command *cmd = &command->command.dysymtab;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->ilocalsym = bfd_h_get_32 (abfd, raw.ilocalsym);
cmd->nlocalsym = bfd_h_get_32 (abfd, raw.nlocalsym);
cmd->dylib_module =
bfd_alloc (abfd, cmd->nmodtab * sizeof (bfd_mach_o_dylib_module));
if (cmd->dylib_module == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->modtaboff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->nmodtab; i++)
{
unsigned char buf[56];
if (bfd_bread ((void *) buf, module_len, abfd) != module_len)
- return -1;
+ return FALSE;
module->module_name_idx = bfd_h_get_32 (abfd, buf + 0);
module->iextdefsym = bfd_h_get_32 (abfd, buf + 4);
cmd->dylib_toc = bfd_alloc
(abfd, cmd->ntoc * sizeof (bfd_mach_o_dylib_table_of_content));
if (cmd->dylib_toc == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->tocoff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->ntoc; i++)
{
bfd_mach_o_dylib_table_of_content *toc = &cmd->dylib_toc[i];
if (bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
toc->symbol_index = bfd_h_get_32 (abfd, raw.symbol_index);
toc->module_index = bfd_h_get_32 (abfd, raw.module_index);
cmd->indirect_syms = bfd_alloc
(abfd, cmd->nindirectsyms * sizeof (unsigned int));
if (cmd->indirect_syms == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->indirectsymoff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->nindirectsyms; i++)
{
unsigned int *is = &cmd->indirect_syms[i];
if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
*is = bfd_h_get_32 (abfd, raw);
}
cmd->ext_refs = bfd_alloc
(abfd, cmd->nextrefsyms * sizeof (bfd_mach_o_dylib_reference));
if (cmd->ext_refs == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->extrefsymoff, SEEK_SET) != 0)
- return -1;
+ return FALSE;
for (i = 0; i < cmd->nextrefsyms; i++)
{
bfd_mach_o_dylib_reference *ref = &cmd->ext_refs[i];
if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
/* Fields isym and flags are written as bit-fields, thus we need
a specific processing for endianness. */
}
if (mdata->dysymtab)
- return -1;
+ return FALSE;
mdata->dysymtab = cmd;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_symtab (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_symtab_command *symtab = &command->command.symtab;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
symtab->symoff = bfd_h_get_32 (abfd, raw.symoff);
symtab->nsyms = bfd_h_get_32 (abfd, raw.nsyms);
abfd->flags |= HAS_SYMS;
if (mdata->symtab)
- return -1;
+ return FALSE;
mdata->symtab = symtab;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_uuid (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_uuid_command *cmd = &command->command.uuid;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (cmd->uuid, 16, abfd) != 16)
- return -1;
+ return FALSE;
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_linkedit (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_linkedit_command *cmd = &command->command.linkedit;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->dataoff = bfd_get_32 (abfd, raw.dataoff);
cmd->datasize = bfd_get_32 (abfd, raw.datasize);
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_str (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_str_command *cmd = &command->command.str;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
off = bfd_get_32 (abfd, raw.str);
cmd->stroff = command->offset + off;
cmd->str_len = command->len - off;
cmd->str = bfd_alloc (abfd, cmd->str_len);
if (cmd->str == NULL)
- return -1;
+ return FALSE;
if (bfd_seek (abfd, cmd->stroff, SEEK_SET) != 0
|| bfd_bread ((void *) cmd->str, cmd->str_len, abfd) != cmd->str_len)
- return -1;
- return 0;
+ return FALSE;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_dyld_info (bfd *abfd, bfd_mach_o_load_command *command)
{
bfd_mach_o_dyld_info_command *cmd = &command->command.dyld_info;
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
cmd->rebase_off = bfd_get_32 (abfd, raw.rebase_off);
cmd->rebase_size = bfd_get_32 (abfd, raw.rebase_size);
cmd->lazy_bind_size = bfd_get_32 (abfd, raw.lazy_bind_size);
cmd->export_off = bfd_get_32 (abfd, raw.export_off);
cmd->export_size = bfd_get_32 (abfd, raw.export_size);
- return 0;
+ return TRUE;
}
static bfd_boolean
return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_segment (bfd *abfd,
bfd_mach_o_load_command *command,
unsigned int wide)
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
memcpy (seg->segname, raw.segname, 16);
seg->segname[16] = '\0';
if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0
|| bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return -1;
+ return FALSE;
memcpy (seg->segname, raw.segname, 16);
seg->segname[16] = '\0';
sec = bfd_mach_o_read_section (abfd, segoff, seg->initprot, wide);
if (sec == NULL)
- return -1;
+ return FALSE;
bfd_mach_o_append_section_to_segment (seg, sec);
}
- return 0;
+ return TRUE;
}
-static int
+static bfd_boolean
bfd_mach_o_read_segment_32 (bfd *abfd, bfd_mach_o_load_command *command)
{
return bfd_mach_o_read_segment (abfd, command, 0);
}
-static int
+static bfd_boolean
bfd_mach_o_read_segment_64 (bfd *abfd, bfd_mach_o_load_command *command)
{
return bfd_mach_o_read_segment (abfd, command, 1);
}
-static int
+static bfd_boolean
bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
{
struct mach_o_load_command_external raw;
/* Read command type and length. */
if (bfd_seek (abfd, command->offset, SEEK_SET) != 0
|| bfd_bread (&raw, BFD_MACH_O_LC_SIZE, abfd) != BFD_MACH_O_LC_SIZE)
- return -1;
+ return FALSE;
cmd = bfd_h_get_32 (abfd, raw.cmd);
command->type = cmd & ~BFD_MACH_O_LC_REQ_DYLD;
switch (command->type)
{
case BFD_MACH_O_LC_SEGMENT:
- if (bfd_mach_o_read_segment_32 (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_segment_32 (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_SEGMENT_64:
- if (bfd_mach_o_read_segment_64 (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_segment_64 (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_SYMTAB:
- if (bfd_mach_o_read_symtab (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_symtab (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_SYMSEG:
break;
case BFD_MACH_O_LC_THREAD:
case BFD_MACH_O_LC_UNIXTHREAD:
- if (bfd_mach_o_read_thread (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_thread (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_LOAD_DYLINKER:
case BFD_MACH_O_LC_ID_DYLINKER:
case BFD_MACH_O_LC_DYLD_ENVIRONMENT:
- if (bfd_mach_o_read_dylinker (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_dylinker (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_LOAD_DYLIB:
case BFD_MACH_O_LC_LAZY_LOAD_DYLIB:
case BFD_MACH_O_LC_LOAD_WEAK_DYLIB:
case BFD_MACH_O_LC_REEXPORT_DYLIB:
case BFD_MACH_O_LC_LOAD_UPWARD_DYLIB:
- if (bfd_mach_o_read_dylib (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_dylib (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_PREBOUND_DYLIB:
- if (bfd_mach_o_read_prebound_dylib (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_prebound_dylib (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_LOADFVMLIB:
case BFD_MACH_O_LC_IDFVMLIB:
- if (bfd_mach_o_read_fvmlib (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_fvmlib (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_IDENT:
case BFD_MACH_O_LC_FVMFILE:
case BFD_MACH_O_LC_SUB_LIBRARY:
case BFD_MACH_O_LC_SUB_CLIENT:
case BFD_MACH_O_LC_RPATH:
- if (bfd_mach_o_read_str (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_str (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_DYSYMTAB:
- if (bfd_mach_o_read_dysymtab (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_dysymtab (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_PREBIND_CKSUM:
- if (bfd_mach_o_read_prebind_cksum (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_prebind_cksum (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_TWOLEVEL_HINTS:
- if (bfd_mach_o_read_twolevel_hints (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_twolevel_hints (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_UUID:
- if (bfd_mach_o_read_uuid (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_uuid (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_CODE_SIGNATURE:
case BFD_MACH_O_LC_SEGMENT_SPLIT_INFO:
case BFD_MACH_O_LC_FUNCTION_STARTS:
case BFD_MACH_O_LC_DATA_IN_CODE:
case BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS:
- if (bfd_mach_o_read_linkedit (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_linkedit (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_ENCRYPTION_INFO:
if (!bfd_mach_o_read_encryption_info (abfd, command))
- return -1;
+ return FALSE;
break;
case BFD_MACH_O_LC_DYLD_INFO:
- if (bfd_mach_o_read_dyld_info (abfd, command) != 0)
- return -1;
+ if (!bfd_mach_o_read_dyld_info (abfd, command))
+ return FALSE;
break;
case BFD_MACH_O_LC_VERSION_MIN_MACOSX:
case BFD_MACH_O_LC_VERSION_MIN_IPHONEOS:
if (!bfd_mach_o_read_version_min (abfd, command))
- return -1;
+ return FALSE;
break;
case BFD_MACH_O_LC_MAIN:
if (!bfd_mach_o_read_main (abfd, command))
- return -1;
+ return FALSE;
break;
case BFD_MACH_O_LC_SOURCE_VERSION:
if (!bfd_mach_o_read_source_version (abfd, command))
- return -1;
+ return FALSE;
break;
default:
(*_bfd_error_handler)(_("%B: unknown load command 0x%lx"),
break;
}
- return 0;
+ return TRUE;
}
static void
cur->offset = prev->offset + prev->len;
}
- if (bfd_mach_o_read_command (abfd, cur) < 0)
+ if (!bfd_mach_o_read_command (abfd, cur))
return FALSE;
}
}
{
unsigned char *buf = NULL;
unsigned int len = 0;
- int ret = -1;
+ int ret;
ret = bfd_mach_o_core_fetch_environment (abfd, &buf, &len);
if (ret < 0)