Lines Matching refs:arhdr
496 Elf_Arhdr *arhdr = elf_getarhdr (subelf); in do_oper_extract() local
498 if (strcmp (arhdr->ar_name, "/") == 0) in do_oper_extract()
501 index_size = arhdr->ar_size; in do_oper_extract()
504 if (strcmp (arhdr->ar_name, "//") == 0) in do_oper_extract()
509 arlib_add_symbols (elf, arfname, arhdr->ar_name, cur_off); in do_oper_extract()
510 cur_off += (((arhdr->ar_size + 1) & ~((off_t) 1)) in do_oper_extract()
518 entry.key = arhdr->ar_name; in do_oper_extract()
531 printf ("\n<%s>\n\n", arhdr->ar_name); in do_oper_extract()
540 struct tm *tp = localtime (&arhdr->ar_date); in do_oper_extract()
550 (arhdr->ar_mode & S_IRUSR) ? 'r' : '-', in do_oper_extract()
551 (arhdr->ar_mode & S_IWUSR) ? 'w' : '-', in do_oper_extract()
552 (arhdr->ar_mode & S_IXUSR) in do_oper_extract()
553 ? ((arhdr->ar_mode & S_ISUID) ? 's' : 'x') in do_oper_extract()
554 : ((arhdr->ar_mode & S_ISUID) ? 'S' : '-'), in do_oper_extract()
555 (arhdr->ar_mode & S_IRGRP) ? 'r' : '-', in do_oper_extract()
556 (arhdr->ar_mode & S_IWGRP) ? 'w' : '-', in do_oper_extract()
557 (arhdr->ar_mode & S_IXGRP) in do_oper_extract()
558 ? ((arhdr->ar_mode & S_ISGID) ? 's' : 'x') in do_oper_extract()
559 : ((arhdr->ar_mode & S_ISGID) ? 'S' : '-'), in do_oper_extract()
560 (arhdr->ar_mode & S_IROTH) ? 'r' : '-', in do_oper_extract()
561 (arhdr->ar_mode & S_IWOTH) ? 'w' : '-', in do_oper_extract()
562 (arhdr->ar_mode & S_IXOTH) in do_oper_extract()
563 ? ((arhdr->ar_mode & S_ISVTX) ? 't' : 'x') in do_oper_extract()
564 : ((arhdr->ar_mode & S_ISVTX) ? 'T' : '-'), in do_oper_extract()
565 arhdr->ar_uid, in do_oper_extract()
566 arhdr->ar_gid, in do_oper_extract()
567 (uintmax_t) arhdr->ar_size, in do_oper_extract()
569 arhdr->ar_name); in do_oper_extract()
572 printf ("x - %s\n", arhdr->ar_name); in do_oper_extract()
578 puts (arhdr->ar_name); in do_oper_extract()
588 arhdr->ar_name, elf_errmsg (-1)); in do_oper_extract()
611 xfd = open (arhdr->ar_name, flags, 0600); in do_oper_extract()
622 *((char *) mempcpy (truncfname, arhdr->ar_name, in do_oper_extract()
631 (int) printlen, arhdr->ar_name); in do_oper_extract()
652 error (0, errno, _("failed to write %s"), arhdr->ar_name); in do_oper_extract()
662 if (unlikely (fchmod (xfd, arhdr->ar_mode) != 0)) in do_oper_extract()
665 arhdr->ar_name); in do_oper_extract()
672 tv[0].tv_sec = arhdr->ar_date; in do_oper_extract()
674 tv[1].tv_sec = arhdr->ar_date; in do_oper_extract()
681 arhdr->ar_name); in do_oper_extract()
694 r = link (tempfname, arhdr->ar_name); in do_oper_extract()
699 r = rename (tempfname, arhdr->ar_name); in do_oper_extract()
711 *((char *) mempcpy (truncfname, arhdr->ar_name, in do_oper_extract()
728 printlen, arhdr->ar_name); in do_oper_extract()
848 struct ar_hdr arhdr; in write_member() local
852 char tmpbuf[sizeof (arhdr.ar_name) + 2]; in write_member()
859 memcpy (&arhdr, elf_rawfile (elf, NULL) + *startp, sizeof (arhdr)); in write_member()
862 (int) sizeof (arhdr.ar_name), memb->long_name_off); in write_member()
863 changed_header = memcmp (arhdr.ar_name, tmpbuf, in write_member()
864 sizeof (arhdr.ar_name)) != 0; in write_member()
885 memcpy (arhdr.ar_name, tmpbuf, sizeof (arhdr.ar_name)); in write_member()
887 if (unlikely (write_retry (newfd, &arhdr, sizeof (arhdr)) in write_member()
888 != sizeof (arhdr))) in write_member()
941 Elf_Arhdr *arhdr = elf_getarhdr (subelf); in do_oper_delete() local
944 if (strcmp (arhdr->ar_name, "/") == 0 in do_oper_delete()
945 || strcmp (arhdr->ar_name, "//") == 0) in do_oper_delete()
952 entry.key = arhdr->ar_name; in do_oper_delete()
962 printf ("d - %s\n", arhdr->ar_name); in do_oper_delete()
970 cur_off += (((arhdr->ar_size + 1) & ~((off_t) 1)) in do_oper_delete()
983 arlib_add_symbols (subelf, arfname, arhdr->ar_name, newp->off); in do_oper_delete()
986 remember_long_name (newp, arhdr->ar_name, strlen (arhdr->ar_name)); in do_oper_delete()
1150 Elf_Arhdr *arhdr = elf_getarhdr (subelf); in do_oper_insert() local
1153 if (strcmp (arhdr->ar_name, "/") == 0 in do_oper_insert()
1154 || strcmp (arhdr->ar_name, "//") == 0) in do_oper_insert()
1159 newp->size = arhdr->ar_size; in do_oper_insert()
1160 newp->sec = arhdr->ar_date; in do_oper_insert()
1164 remember_long_name (newp, arhdr->ar_name, strlen (arhdr->ar_name)); in do_oper_insert()
1170 if (member != NULL && strcmp (arhdr->ar_name, member) == 0) in do_oper_insert()
1181 entry.key = arhdr->ar_name; in do_oper_insert()
1365 Elf_Arhdr *arhdr; in do_oper_insert() local
1367 asm ("" : "=m" (arhdr), "=m" (subelf)); in do_oper_insert()
1370 || (arhdr = elf_getarhdr (subelf)) == NULL) in do_oper_insert()
1375 arlib_add_symbols (subelf, arfname, arhdr->ar_name, cur_off); in do_oper_insert()
1456 struct ar_hdr arhdr; in do_oper_insert() local
1461 char tmpbuf[sizeof (arhdr.ar_name) + 2]; in do_oper_insert()
1465 char *p = mempcpy (arhdr.ar_name, all->name, namelen); in do_oper_insert()
1467 memset (p, ' ', sizeof (arhdr.ar_name) - namelen - 1); in do_oper_insert()
1472 (int) sizeof (arhdr.ar_name), all->long_name_off); in do_oper_insert()
1473 memcpy (arhdr.ar_name, tmpbuf, sizeof (arhdr.ar_name)); in do_oper_insert()
1476 if (! no0print (false, arhdr.ar_date, sizeof (arhdr.ar_date), in do_oper_insert()
1482 if (! no0print (false, arhdr.ar_uid, sizeof (arhdr.ar_uid), in do_oper_insert()
1488 if (! no0print (false, arhdr.ar_gid, sizeof (arhdr.ar_gid), in do_oper_insert()
1494 if (! no0print (true, arhdr.ar_mode, sizeof (arhdr.ar_mode), in do_oper_insert()
1500 if (! no0print (false, arhdr.ar_size, sizeof (arhdr.ar_size), in do_oper_insert()
1506 memcpy (arhdr.ar_fmag, ARFMAG, sizeof (arhdr.ar_fmag)); in do_oper_insert()
1508 if (unlikely (write_retry (newfd, &arhdr, sizeof (arhdr)) in do_oper_insert()
1509 != sizeof (arhdr))) in do_oper_insert()