Lines Matching refs:header
169 for (i = 0; i < mdata->header.ncmds; i++)
201 for (i = 0; i < mdata->header.ncmds; i++)
290 bfd_mach_o_write_header (bfd *abfd, bfd_mach_o_header *header)
294 bfd_h_put_32 (abfd, header->magic, buf + 0);
295 bfd_h_put_32 (abfd, header->cputype, buf + 4);
296 bfd_h_put_32 (abfd, header->cpusubtype, buf + 8);
297 bfd_h_put_32 (abfd, header->filetype, buf + 12);
298 bfd_h_put_32 (abfd, header->ncmds, buf + 16);
299 bfd_h_put_32 (abfd, header->sizeofcmds, buf + 20);
300 bfd_h_put_32 (abfd, header->flags, buf + 24);
499 /* Write data sections first in case they overlap header data to be
505 /* Now write header information. */
506 if (bfd_mach_o_write_header (abfd, &mdata->header) != 0)
509 for (i = 0; i < mdata->header.ncmds; i++)
590 bfd_mach_o_read_header (bfd *abfd, bfd_mach_o_header *header)
602 header->byteorder = BFD_ENDIAN_BIG;
603 header->magic = 0xfeedface;
608 header->byteorder = BFD_ENDIAN_LITTLE;
609 header->magic = 0xfeedface;
614 header->byteorder = BFD_ENDIAN_UNKNOWN;
618 header->cputype = (*get32) (buf + 4);
619 header->cpusubtype = (*get32) (buf + 8);
620 header->filetype = (*get32) (buf + 12);
621 header->ncmds = (*get32) (buf + 16);
622 header->sizeofcmds = (*get32) (buf + 20);
623 header->flags = (*get32) (buf + 24);
1114 switch (mdata->header.cputype)
1396 for (i = 0; i < mdata->header.ncmds; i++)
1411 for (i = 0; i < mdata->header.ncmds; i++)
1433 for (i = 0; i < mdata->header.ncmds; i++)
1450 if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_I386)
1463 else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_POWERPC)
1482 bfd_mach_o_header *header,
1489 mdata->header = *header;
1496 bfd_mach_o_convert_architecture (header->cputype, header->cpusubtype,
1501 header->cputype, header->cpusubtype);
1507 if (header->ncmds != 0)
1509 mdata->commands = bfd_alloc (abfd, header->ncmds * sizeof (bfd_mach_o_load_command));
1513 for (i = 0; i < header->ncmds; i++)
1547 mdata->header.magic = 0;
1548 mdata->header.cputype = 0;
1549 mdata->header.cpusubtype = 0;
1550 mdata->header.filetype = 0;
1551 mdata->header.ncmds = 0;
1552 mdata->header.sizeofcmds = 0;
1553 mdata->header.flags = 0;
1554 mdata->header.byteorder = BFD_ENDIAN_UNKNOWN;
1569 bfd_mach_o_header header;
1572 if (bfd_mach_o_read_header (abfd, &header) != 0)
1575 if (! (header.byteorder == BFD_ENDIAN_BIG
1576 || header.byteorder == BFD_ENDIAN_LITTLE))
1578 fprintf (stderr, "unknown header byte-order value 0x%lx\n",
1579 (long) header.byteorder);
1583 if (! ((header.byteorder == BFD_ENDIAN_BIG
1586 || (header.byteorder == BFD_ENDIAN_LITTLE
1596 if (bfd_mach_o_scan (abfd, &header,
1616 bfd_mach_o_header header;
1619 if (bfd_mach_o_read_header (abfd, &header) != 0)
1622 if (! (header.byteorder == BFD_ENDIAN_BIG
1623 || header.byteorder == BFD_ENDIAN_LITTLE))
1625 fprintf (stderr, "unknown header byte-order value 0x%lx\n",
1626 (long) header.byteorder);
1630 if (! ((header.byteorder == BFD_ENDIAN_BIG
1633 || (header.byteorder == BFD_ENDIAN_LITTLE
1638 if (header.filetype != BFD_MACH_O_MH_CORE)
1646 if (bfd_mach_o_scan (abfd, &header,
1802 for (i = 0; i < md->header.ncmds; i++)
1851 for (i = 0; i < md->header.ncmds; i++)
1897 unsigned long stackaddr = bfd_mach_o_stack_addr (mdata->header.cputype);
1900 for (i = 0; i < mdata->header.ncmds; i++)