/[gentoo-projects]/pax-utils/scanelf.c
Gentoo

Diff of /pax-utils/scanelf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.165 Revision 1.166
1/* 1/*
2 * Copyright 2003-2006 Gentoo Foundation 2 * Copyright 2003-2006 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/scanelf.c,v 1.165 2006/12/11 03:24:03 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.166 2006/12/11 03:31:54 vapier Exp $
5 * 5 *
6 * Copyright 2003-2006 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2006 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2006 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2006 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10#include "paxinc.h" 10#include "paxinc.h"
11 11
12static const char *rcsid = "$Id: scanelf.c,v 1.165 2006/12/11 03:24:03 vapier Exp $"; 12static const char *rcsid = "$Id: scanelf.c,v 1.166 2006/12/11 03:31:54 vapier Exp $";
13#define argv0 "scanelf" 13#define argv0 "scanelf"
14 14
15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') 15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
16 16
17/* prototypes */ 17/* prototypes */
1055 case 'S': prints("SONAME "); break; 1055 case 'S': prints("SONAME "); break;
1056 case 's': prints("SYM "); break; 1056 case 's': prints("SYM "); break;
1057 case 'N': prints("LIB "); break; 1057 case 'N': prints("LIB "); break;
1058 case 'T': prints("TEXTRELS "); break; 1058 case 'T': prints("TEXTRELS "); break;
1059 case 'k': prints("SECTION "); break; 1059 case 'k': prints("SECTION "); break;
1060 case 'a': prints("ARCH "); break;
1060 default: warnf("'%c' has no title ?", out_format[i]); 1061 default: warnf("'%c' has no title ?", out_format[i]);
1061 } 1062 }
1062 } 1063 }
1063 if (!found_file) prints("FILE "); 1064 if (!found_file) prints("FILE ");
1064 prints("\n"); 1065 prints("\n");
1121 case 'i': out = scanelf_file_interp(elf, &found_interp); break; 1122 case 'i': out = scanelf_file_interp(elf, &found_interp); break;
1122 case 'b': out = scanelf_file_bind(elf, &found_bind); break; 1123 case 'b': out = scanelf_file_bind(elf, &found_bind); break;
1123 case 'S': out = scanelf_file_soname(elf, &found_soname); break; 1124 case 'S': out = scanelf_file_soname(elf, &found_soname); break;
1124 case 's': out = scanelf_file_sym(elf, &found_sym); break; 1125 case 's': out = scanelf_file_sym(elf, &found_sym); break;
1125 case 'k': out = scanelf_file_sections(elf, &found_section); break; 1126 case 'k': out = scanelf_file_sections(elf, &found_section); break;
1127 case 'a': out = get_elfemtype(elf); break;
1126 default: warnf("'%c' has no scan code?", out_format[i]); 1128 default: warnf("'%c' has no scan code?", out_format[i]);
1127 } 1129 }
1128 if (out) { 1130 if (out) {
1129 /* hack for comma delimited output like `scanelf -s sym1,sym2,sym3` */ 1131 /* hack for comma delimited output like `scanelf -s sym1,sym2,sym3` */
1130 if (out_format[i] == 's' && (tmp=strchr(out,',')) != NULL) 1132 if (out_format[i] == 's' && (tmp=strchr(out,',')) != NULL)
1581 puts("\nThe format modifiers for the -F option are:"); 1583 puts("\nThe format modifiers for the -F option are:");
1582 puts(" F Filename \tx PaX Flags \te STACK/RELRO"); 1584 puts(" F Filename \tx PaX Flags \te STACK/RELRO");
1583 puts(" t TEXTREL \tr RPATH \tn NEEDED"); 1585 puts(" t TEXTREL \tr RPATH \tn NEEDED");
1584 puts(" i INTERP \tb BIND \ts symbol"); 1586 puts(" i INTERP \tb BIND \ts symbol");
1585 puts(" N library \to Type \tT TEXTRELs"); 1587 puts(" N library \to Type \tT TEXTRELs");
1586 puts(" S SONAME \tk section"); 1588 puts(" S SONAME \tk section \ta arch");
1587 puts(" p filename (with search path removed)"); 1589 puts(" p filename (with search path removed)");
1588 puts(" f filename (short name/basename)"); 1590 puts(" f filename (short name/basename)");
1589 puts("Prefix each modifier with '%' (verbose) or '#' (silent)"); 1591 puts("Prefix each modifier with '%' (verbose) or '#' (silent)");
1590 1592
1591 puts("\nELF Etypes:"); 1593 puts("\nELF Etypes:");
1749 case 'f': break; 1751 case 'f': break;
1750 case 'k': break; 1752 case 'k': break;
1751 case 's': break; 1753 case 's': break;
1752 case 'N': break; 1754 case 'N': break;
1753 case 'o': break; 1755 case 'o': break;
1756 case 'a': break;
1754 case 'x': show_pax = 1; break; 1757 case 'x': show_pax = 1; break;
1755 case 'e': show_phdr = 1; break; 1758 case 'e': show_phdr = 1; break;
1756 case 't': show_textrel = 1; break; 1759 case 't': show_textrel = 1; break;
1757 case 'r': show_rpath = 1; break; 1760 case 'r': show_rpath = 1; break;
1758 case 'n': show_needed = 1; break; 1761 case 'n': show_needed = 1; break;

Legend:
Removed from v.1.165  
changed lines
  Added in v.1.166

  ViewVC Help
Powered by ViewVC 1.1.20