Home | History | Annotate | Download | only in libelf

Lines Matching defs:ar_hdr

577   struct ar_hdr hdrm;
578 struct ar_hdr *hdr;
586 if (offset + sizeof (struct ar_hdr) > elf->maximum_size)
590 hdr = (struct ar_hdr *) (elf->map_address + offset);
607 offset += sizeof (struct ar_hdr) + ((len + 1) & ~1l);
622 + sizeof (struct ar_hdr),
628 + sizeof (struct ar_hdr))
673 struct ar_hdr *ar_hdr;
679 if (elf->state.ar.offset + sizeof (struct ar_hdr)
686 ar_hdr = (struct ar_hdr *) (elf->map_address + elf->state.ar.offset);
690 ar_hdr = &elf->state.ar.ar_hdr;
692 if (pread (elf->fildes, ar_hdr, sizeof (struct ar_hdr),
694 != sizeof (struct ar_hdr))
703 if (memcmp (ar_hdr->ar_fmag, ARFMAG, 2) != 0)
711 *((char *) __mempcpy (elf->state.ar.raw_name, ar_hdr->ar_name, 16)) = '\0';
715 /* Now convert the `struct ar_hdr' into `Elf_Arhdr'.
717 if (ar_hdr->ar_name[0] == '/')
719 if (ar_hdr->ar_name[1] == ' '
720 && memcmp (ar_hdr->ar_name, "/ ", 16) == 0)
723 else if (ar_hdr->ar_name[1] == '/'
724 && memcmp (ar_hdr->ar_name, "// ", 16) == 0)
727 else if (isdigit (ar_hdr->ar_name[1]))
742 offset = atol (ar_hdr->ar_name + 1);
763 endp = (char *) memccpy (elf->state.ar.ar_name, ar_hdr->ar_name,
776 for the case where the whole field in the `struct ar_hdr' is
779 if (ar_hdr->ar_date[sizeof (ar_hdr->ar_date) - 1] == ' ')
781 if (ar_hdr->ar_date[0] == ' ')
785 ? (time_t) atol (ar_hdr->ar_date)
786 : (time_t) atoll (ar_hdr->ar_date));
790 char buf[sizeof (ar_hdr->ar_date) + 1];
791 *((char *) __mempcpy (buf, ar_hdr->ar_date, sizeof (ar_hdr->ar_date)))
794 ? (time_t) atol (ar_hdr->ar_date)
795 : (time_t) atoll (ar_hdr->ar_date));
798 if (ar_hdr->ar_uid[sizeof (ar_hdr->ar_uid) - 1] == ' ')
800 if (ar_hdr->ar_uid[0] == ' ')
804 ? (uid_t) atol (ar_hdr->ar_uid)
805 : (uid_t) atoll (ar_hdr->ar_uid));
809 char buf[sizeof (ar_hdr->ar_uid) + 1];
810 *((char *) __mempcpy (buf, ar_hdr->ar_uid, sizeof (ar_hdr->ar_uid)))
813 ? (uid_t) atol (ar_hdr->ar_uid)
814 : (uid_t) atoll (ar_hdr->ar_uid));
817 if (ar_hdr->ar_gid[sizeof (ar_hdr->ar_gid) - 1] == ' ')
819 if (ar_hdr->ar_gid[0] == ' ')
823 ? (gid_t) atol (ar_hdr->ar_gid)
824 : (gid_t) atoll (ar_hdr->ar_gid));
828 char buf[sizeof (ar_hdr->ar_gid) + 1];
829 *((char *) __mempcpy (buf, ar_hdr->ar_gid, sizeof (ar_hdr->ar_gid)))
832 ? (gid_t) atol (ar_hdr->ar_gid)
833 : (gid_t) atoll (ar_hdr->ar_gid));
836 if (ar_hdr->ar_mode[sizeof (ar_hdr->ar_mode) - 1] == ' ')
838 if (ar_hdr->ar_mode[0] == ' ')
842 ? (mode_t) strtol (ar_hdr->ar_mode, NULL, 8)
843 : (mode_t) strtoll (ar_hdr->ar_mode, NULL, 8));
847 char buf[sizeof (ar_hdr->ar_mode) + 1];
848 *((char *) __mempcpy (buf, ar_hdr->ar_mode, sizeof (ar_hdr->ar_mode)))
851 ? (mode_t) strtol (ar_hdr->ar_mode, NULL, 8)
852 : (mode_t) strtoll (ar_hdr->ar_mode, NULL, 8));
855 if (ar_hdr->ar_size[sizeof (ar_hdr->ar_size) - 1] == ' ')
857 if (ar_hdr->ar_size[0] == ' ')
867 ? (off_t) atol (ar_hdr->ar_size)
868 : (off_t) atoll (ar_hdr->ar_size));
872 char buf[sizeof (ar_hdr->ar_size) + 1];
873 *((char *) __mempcpy (buf, ar_hdr->ar_size, sizeof (ar_hdr->ar_size)))
876 ? (off_t) atol (ar_hdr->ar_size)
877 : (off_t) atoll (ar_hdr->ar_size));
935 result = read_file (fildes, ref->state.ar.offset + sizeof (struct ar_hdr),