/[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.155 Revision 1.156
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.155 2006/06/11 00:07:33 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.156 2006/06/11 00:23:11 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.155 2006/06/11 00:07:33 vapier Exp $"; 12static const char *rcsid = "$Id: scanelf.c,v 1.156 2006/06/11 00:23:11 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#define do_state(option, flag) \ 17#define do_state(option, flag) \
924 get_elfstttype(sym->st_info), \ 924 get_elfstttype(sym->st_info), \
925 symname); \ 925 symname); \
926 *found_sym = 1; \ 926 *found_sym = 1; \
927 } else { \ 927 } else { \
928 /* allow the user to specify a comma delimited list of symbols to search for */ \ 928 /* allow the user to specify a comma delimited list of symbols to search for */ \
929 char *this_sym, *next_sym; \ 929 char *this_sym, *this_sym_ver, *next_sym; \
930 this_sym = ret; \ 930 this_sym = ret; \
931 this_sym_ver = versioned_symname; \
931 do { \ 932 do { \
932 next_sym = strchr(this_sym, ','); \ 933 next_sym = strchr(this_sym, ','); \
933 if (next_sym == NULL) \ 934 if (next_sym == NULL) \
934 next_sym = this_sym + strlen(this_sym); \ 935 next_sym = this_sym + strlen(this_sym); \
935 /* do we want a defined symbol ? */ \ 936 /* do we want a defined symbol ? */ \
936 if (*this_sym == '+') { \ 937 if (*this_sym == '+') { \
937 if (sym->st_shndx == SHN_UNDEF) \ 938 if (sym->st_shndx == SHN_UNDEF) \
938 goto skip_this_sym##B; \ 939 goto skip_this_sym##B; \
939 ++this_sym; \ 940 ++this_sym; \
941 ++this_sym_ver; \
940 /* do we want an undefined symbol ? */ \ 942 /* do we want an undefined symbol ? */ \
941 } else if (*this_sym == '-') { \ 943 } else if (*this_sym == '-') { \
942 if (sym->st_shndx != SHN_UNDEF) \ 944 if (sym->st_shndx != SHN_UNDEF) \
943 goto skip_this_sym##B; \ 945 goto skip_this_sym##B; \
944 ++this_sym; \ 946 ++this_sym; \
947 ++this_sym_ver; \
945 } \ 948 } \
946 /* ok, lets compare the name now */ \ 949 /* ok, lets compare the name now */ \
947 if ((strncmp(this_sym, symname, (next_sym-this_sym)) == 0 && symname[next_sym-this_sym] == '\0') || \ 950 if ((strncmp(this_sym, symname, (next_sym-this_sym)) == 0 && symname[next_sym-this_sym] == '\0') || \
948 (strncmp(symname, versioned_symname, strlen(versioned_symname)) == 0)) { \ 951 (strncmp(this_sym_ver, symname, strlen(this_sym_ver)) == 0)) { \
949 if (be_semi_verbose) { \ 952 if (be_semi_verbose) { \
950 char buf[126]; \ 953 char buf[126]; \
951 snprintf(buf, sizeof(buf), "%lX %s %s", \ 954 snprintf(buf, sizeof(buf), "%lX %s %s", \
952 (unsigned long)sym->st_size, get_elfstttype(sym->st_info), this_sym); \ 955 (unsigned long)sym->st_size, get_elfstttype(sym->st_info), this_sym); \
953 ret = buf; \ 956 ret = buf; \

Legend:
Removed from v.1.155  
changed lines
  Added in v.1.156

  ViewVC Help
Powered by ViewVC 1.1.20