/[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.21 Revision 1.22
1/* 1/*
2 * Copyright 2003 Ned Ludd <solar@gentoo.org> 2 * Copyright 2003 Ned Ludd <solar@gentoo.org>
3 * Copyright 1999-2005 Gentoo Foundation 3 * Copyright 1999-2005 Gentoo Foundation
4 * Distributed under the terms of the GNU General Public License v2 4 * Distributed under the terms of the GNU General Public License v2
5 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.21 2005/04/03 16:02:25 solar Exp $ 5 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.22 2005/04/03 18:03:22 vapier Exp $
6 * 6 *
7 ******************************************************************** 7 ********************************************************************
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as 9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the 10 * published by the Free Software Foundation; either version 2 of the
32#include <getopt.h> 32#include <getopt.h>
33#include <assert.h> 33#include <assert.h>
34 34
35#include "paxelf.h" 35#include "paxelf.h"
36 36
37static const char *rcsid = "$Id: scanelf.c,v 1.21 2005/04/03 16:02:25 solar Exp $"; 37static const char *rcsid = "$Id: scanelf.c,v 1.22 2005/04/03 18:03:22 vapier Exp $";
38 38
39 39
40/* helper functions for showing errors */ 40/* helper functions for showing errors */
41#define argv0 "scanelf" /*((*argv != NULL) ? argv[0] : __FILE__ "\b\b")*/ 41#define argv0 "scanelf" /*((*argv != NULL) ? argv[0] : __FILE__ "\b\b")*/
42#define warn(fmt, args...) \ 42#define warn(fmt, args...) \
86 /* verify this is real ELF */ 86 /* verify this is real ELF */
87 if ((elf = readelf(filename)) == NULL) { 87 if ((elf = readelf(filename)) == NULL) {
88 if (be_verbose > 1) printf("%s: not an ELF\n", filename); 88 if (be_verbose > 1) printf("%s: not an ELF\n", filename);
89 return; 89 return;
90 } 90 }
91 if (check_elf_header(elf->ehdr) || !IS_ELF(elf)) {
92 if (be_verbose > 1) printf("%s: cannot handle ELF :(\n", filename);
93 goto bail;
94 }
95 91
96 if (be_verbose) printf("%s: scanning file\n", filename); 92 if (be_verbose) printf("%s: scanning file\n", filename);
97 93
98 /* show the header */ 94 /* show the header */
99 if (!be_quiet && show_banner) { 95 if (!be_quiet && show_banner) {
179 } 175 }
180 176
181 if (!be_quiet || found_pax || found_stack || found_textrel || found_rpath) 177 if (!be_quiet || found_pax || found_stack || found_textrel || found_rpath)
182 puts(filename); 178 puts(filename);
183 179
184bail:
185 unreadelf(elf); 180 unreadelf(elf);
186} 181}
187 182
188/* scan a directory for ET_EXEC files and print when we find one */ 183/* scan a directory for ET_EXEC files and print when we find one */
189static void scanelf_dir(const char *path) 184static void scanelf_dir(const char *path)

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20