/[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.198 Revision 1.199
1/* 1/*
2 * Copyright 2003-2007 Gentoo Foundation 2 * Copyright 2003-2007 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.198 2008/11/17 18:09:55 flameeyes Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.199 2008/12/10 20:05:20 grobian Exp $
5 * 5 *
6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10static const char *rcsid = "$Id: scanelf.c,v 1.198 2008/11/17 18:09:55 flameeyes Exp $"; 10static const char *rcsid = "$Id: scanelf.c,v 1.199 2008/12/10 20:05:20 grobian Exp $";
11const char * const argv0 = "scanelf"; 11const char * const argv0 = "scanelf";
12 12
13#include "paxinc.h" 13#include "paxinc.h"
14 14
15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') 15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
1037 char *this_sym, *next_sym; \ 1037 char *this_sym, *next_sym; \
1038 next_sym = ret; \ 1038 next_sym = ret; \
1039 while (next_sym) { \ 1039 while (next_sym) { \
1040 this_sym = next_sym; \ 1040 this_sym = next_sym; \
1041 if ((next_sym = strchr(this_sym, ','))) \ 1041 if ((next_sym = strchr(this_sym, ','))) \
1042 next_sym += 1; /* Skip the comma */ \ 1042 *next_sym++ = '\0'; /* Skip the comma */ \
1043 /* do we want a defined symbol ? */ \ 1043 /* do we want a defined symbol ? */ \
1044 if (*this_sym == '+') { \ 1044 if (*this_sym == '+') { \
1045 if (sym->st_shndx == SHN_UNDEF) \ 1045 if (sym->st_shndx == SHN_UNDEF) \
1046 continue; \ 1046 continue; \
1047 ++this_sym; \ 1047 ++this_sym; \
1049 } else if (*this_sym == '-') { \ 1049 } else if (*this_sym == '-') { \
1050 if (sym->st_shndx != SHN_UNDEF) \ 1050 if (sym->st_shndx != SHN_UNDEF) \
1051 continue; \ 1051 continue; \
1052 ++this_sym; \ 1052 ++this_sym; \
1053 } \ 1053 } \
1054 if (next_sym) /* Copy it so that we don't have to worry about the final , */ \
1055 this_sym = strndup(this_sym, next_sym-this_sym); \
1056 /* ok, lets compare the name now */ \ 1054 /* ok, lets compare the name now */ \
1057 if (scanelf_match_symname(this_sym, symname)) { \ 1055 if (scanelf_match_symname(this_sym, symname)) { \
1058 if (be_semi_verbose) { \ 1056 if (be_semi_verbose) { \
1059 char buf[126]; \ 1057 char buf[126]; \
1060 snprintf(buf, sizeof(buf), "%lX %s %s", \ 1058 snprintf(buf, sizeof(buf), "%lX %s %s", \
1063 } else \ 1061 } else \
1064 ret = symname; \ 1062 ret = symname; \
1065 (*found_sym)++; \ 1063 (*found_sym)++; \
1066 goto break_out; \ 1064 goto break_out; \
1067 } \ 1065 } \
1068 if (next_sym) free(this_sym); \
1069 } \ 1066 } \
1070 } \ 1067 } \
1071 } \ 1068 } \
1072 ++sym; \ 1069 ++sym; \
1073 } } 1070 } }

Legend:
Removed from v.1.198  
changed lines
  Added in v.1.199

  ViewVC Help
Powered by ViewVC 1.1.20