| 1 | /* |
1 | /* |
| 2 | * Copyright 2008 Gentoo Foundation |
2 | * Copyright 2008 Gentoo Foundation |
| 3 | * Distributed under the terms of the GNU General Public License v2 |
3 | * Distributed under the terms of the GNU General Public License v2 |
| 4 | * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.15 2009/12/20 20:33:31 grobian Exp $ |
4 | * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanmacho.c,v 1.16 2009/12/20 20:37:09 grobian Exp $ |
| 5 | * |
5 | * |
| 6 | * based on scanelf by: |
6 | * based on scanelf by: |
| 7 | * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> |
7 | * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> |
| 8 | * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> |
8 | * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> |
| 9 | * for Darwin specific fun: |
9 | * for Darwin specific fun: |
| 10 | * 2008 Fabian Groffen - <grobian@gentoo.org> |
10 | * 2008 Fabian Groffen - <grobian@gentoo.org> |
| 11 | */ |
11 | */ |
| 12 | |
12 | |
| 13 | static const char *rcsid = "$Id: scanmacho.c,v 1.15 2009/12/20 20:33:31 grobian Exp $"; |
13 | static const char *rcsid = "$Id: scanmacho.c,v 1.16 2009/12/20 20:37:09 grobian Exp $"; |
| 14 | const char * const argv0 = "scanmacho"; |
14 | const char * const argv0 = "scanmacho"; |
| 15 | |
15 | |
| 16 | #include "paxinc.h" |
16 | #include "paxinc.h" |
| 17 | |
17 | |
| 18 | #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') |
18 | #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') |
| … | |
… | |
| 533 | static const char *opts_help[] = { |
533 | static const char *opts_help[] = { |
| 534 | "Scan all directories in PATH environment", |
534 | "Scan all directories in PATH environment", |
| 535 | "Scan directories recursively", |
535 | "Scan directories recursively", |
| 536 | "Don't recursively cross mount points", |
536 | "Don't recursively cross mount points", |
| 537 | "Don't scan symlinks", |
537 | "Don't scan symlinks", |
| 538 | "Scan archives (.a files)", |
538 | "Scan archives (.a files)\n", |
| 539 | "Print LC_LOAD_DYLIB information (ELF: NEEDED)", |
539 | "Print LC_LOAD_DYLIB information (ELF: NEEDED)", |
| 540 | "Print LC_LOAD_DYLINKER information (ELF: INTERP)", |
540 | "Print LC_LOAD_DYLINKER information (ELF: INTERP)", |
| 541 | "Print flags from mach_header (ELF: BIND)", |
541 | "Print flags from mach_header (ELF: BIND)", |
| 542 | "Print LC_ID_DYLIB information (ELF: SONAME)", |
542 | "Print LC_ID_DYLIB information (ELF: SONAME)", |
| 543 | "Find a specified library", |
543 | "Find a specified library", |
| … | |
… | |
| 546 | " MH_OBJECT,MH_EXECUTE ... (ELF: etype)", |
546 | " MH_OBJECT,MH_EXECUTE ... (ELF: etype)", |
| 547 | "Print only Mach-O files matching numeric bits", |
547 | "Print only Mach-O files matching numeric bits", |
| 548 | "Print Endianness", |
548 | "Print Endianness", |
| 549 | "Print only Mach-O files matching octal permissions", |
549 | "Print only Mach-O files matching octal permissions", |
| 550 | "Print Mach-O file size", |
550 | "Print Mach-O file size", |
| 551 | "Print all useful/simple info", |
551 | "Print all useful/simple info\n", |
| 552 | "Only output 'bad' things", |
552 | "Only output 'bad' things", |
| 553 | "Be verbose (can be specified more than once)", |
553 | "Be verbose (can be specified more than once)", |
| 554 | "Use specified format for output", |
554 | "Use specified format for output", |
| 555 | "Read input stream from a filename", |
555 | "Read input stream from a filename", |
| 556 | "Write output stream to a filename", |
556 | "Write output stream to a filename", |