/[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.8 Revision 1.9
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.8 2005/03/25 21:50:20 vapier Exp $ 5 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.9 2005/03/29 23:37:03 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
31#include <getopt.h> 31#include <getopt.h>
32 32
33#include "paxelf.h" 33#include "paxelf.h"
34 34
35static const char *rcsid = 35static const char *rcsid =
36 "$Id: scanelf.c,v 1.8 2005/03/25 21:50:20 vapier Exp $"; 36 "$Id: scanelf.c,v 1.9 2005/03/29 23:37:03 vapier Exp $";
37 37
38#define PARSE_FLAGS "hvlp" 38#define PARSE_FLAGS "hvlp"
39static struct option const long_options[] = { 39static struct option const long_options[] = {
40 {"help", no_argument, 0, 'h'}, 40 {"help", no_argument, 0, 'h'},
41 {"version", no_argument, 0, 'v'}, 41 {"version", no_argument, 0, 'v'},
50 /* verify this is real ELF */ 50 /* verify this is real ELF */
51 if ((elf = readelf(filename)) != NULL) { 51 if ((elf = readelf(filename)) != NULL) {
52 if (!check_elf_header(elf->ehdr)) 52 if (!check_elf_header(elf->ehdr))
53 if (IS_ELF(elf)) 53 if (IS_ELF(elf))
54 printf("%s %s %s\n", 54 printf("%s %s %s\n",
55 pax_short_flags(PAX_FLAGS(elf)), 55 pax_short_hf_flags(PAX_FLAGS(elf)),
56 get_elfetype(elf->ehdr->e_type), filename); 56 get_elfetype(elf->ehdr->e_type), filename);
57 57
58 if (elf != NULL) { 58 if (elf != NULL) {
59 munmap(elf->data, elf->len); 59 munmap(elf->data, elf->len);
60 free(elf); 60 free(elf);

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20