archive.c (251225) | archive.c (251227) |
---|---|
1/* BFD back-end for archive files (libraries). 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 4 Free Software Foundation, Inc. 5 Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. 6 7 This file is part of BFD, the Binary File Descriptor library. 8 --- 1376 unchanged lines hidden (view full) --- 1385 ared = bfd_zalloc (abfd, amt); 1386 if (ared == NULL) 1387 return NULL; 1388 hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata)); 1389 1390 /* ar headers are space padded, not null padded! */ 1391 memset (hdr, ' ', sizeof (struct ar_hdr)); 1392 | 1/* BFD back-end for archive files (libraries). 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 4 Free Software Foundation, Inc. 5 Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. 6 7 This file is part of BFD, the Binary File Descriptor library. 8 --- 1376 unchanged lines hidden (view full) --- 1385 ared = bfd_zalloc (abfd, amt); 1386 if (ared == NULL) 1387 return NULL; 1388 hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata)); 1389 1390 /* ar headers are space padded, not null padded! */ 1391 memset (hdr, ' ', sizeof (struct ar_hdr)); 1392 |
1393 _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", 1394 (long long)status.st_mtime); | 1393 _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", 1394 status.st_mtime); |
1395#ifdef HPUX_LARGE_AR_IDS 1396 /* HP has a very "special" way to handle UID/GID's with numeric values 1397 > 99999. */ 1398 if (status.st_uid > 99999) 1399 hpux_uid_gid_encode (hdr->ar_uid, (long) status.st_uid); 1400 else 1401#endif 1402 _bfd_ar_spacepad (hdr->ar_uid, sizeof (hdr->ar_uid), "%ld", --- 50 unchanged lines hidden (view full) --- 1453 1454 hdr = arch_hdr (abfd); 1455 1456#define foo(arelt, stelt, size) \ 1457 buf->stelt = strtol (hdr->arelt, &aloser, size); \ 1458 if (aloser == hdr->arelt) \ 1459 return -1; 1460 | 1395#ifdef HPUX_LARGE_AR_IDS 1396 /* HP has a very "special" way to handle UID/GID's with numeric values 1397 > 99999. */ 1398 if (status.st_uid > 99999) 1399 hpux_uid_gid_encode (hdr->ar_uid, (long) status.st_uid); 1400 else 1401#endif 1402 _bfd_ar_spacepad (hdr->ar_uid, sizeof (hdr->ar_uid), "%ld", --- 50 unchanged lines hidden (view full) --- 1453 1454 hdr = arch_hdr (abfd); 1455 1456#define foo(arelt, stelt, size) \ 1457 buf->stelt = strtol (hdr->arelt, &aloser, size); \ 1458 if (aloser == hdr->arelt) \ 1459 return -1; 1460 |
1461#define fooll(arelt, stelt, size) \ 1462 buf->stelt = strtoll (hdr->arelt, &aloser, size); \ 1463 if (aloser == hdr->arelt) \ 1464 return -1; 1465 | |
1466 /* Some platforms support special notations for large IDs. */ 1467#ifdef HPUX_LARGE_AR_IDS 1468# define foo2(arelt, stelt, size) \ 1469 if (hdr->arelt[5] == ' ') \ 1470 { \ 1471 foo (arelt, stelt, size); \ 1472 } \ 1473 else \ --- 10 unchanged lines hidden (view full) --- 1484 return -1; \ 1485 buf->stelt <<= 2; \ 1486 buf->stelt += hdr->arelt[5] - '@'; \ 1487 } 1488#else 1489# define foo2(arelt, stelt, size) foo (arelt, stelt, size) 1490#endif 1491 | 1461 /* Some platforms support special notations for large IDs. */ 1462#ifdef HPUX_LARGE_AR_IDS 1463# define foo2(arelt, stelt, size) \ 1464 if (hdr->arelt[5] == ' ') \ 1465 { \ 1466 foo (arelt, stelt, size); \ 1467 } \ 1468 else \ --- 10 unchanged lines hidden (view full) --- 1479 return -1; \ 1480 buf->stelt <<= 2; \ 1481 buf->stelt += hdr->arelt[5] - '@'; \ 1482 } 1483#else 1484# define foo2(arelt, stelt, size) foo (arelt, stelt, size) 1485#endif 1486 |
1492 fooll (ar_date, st_mtime, 10); | 1487 foo (ar_date, st_mtime, 10); |
1493 foo2 (ar_uid, st_uid, 10); 1494 foo2 (ar_gid, st_gid, 10); 1495 foo (ar_mode, st_mode, 8); 1496 1497 buf->st_size = arch_eltdata (abfd)->parsed_size; 1498 1499 return 0; 1500} --- 670 unchanged lines hidden --- | 1488 foo2 (ar_uid, st_uid, 10); 1489 foo2 (ar_gid, st_gid, 10); 1490 foo (ar_mode, st_mode, 8); 1491 1492 buf->st_size = arch_eltdata (abfd)->parsed_size; 1493 1494 return 0; 1495} --- 670 unchanged lines hidden --- |