| 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.143 2006/05/11 05:44:22 solar Exp $ |
4 | * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.144 2006/05/14 03:40:33 solar 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 | |
| … | |
… | |
| 13 | #endif |
13 | #endif |
| 14 | #if defined(__FreeBSD__) || defined(__DragonFly__) |
14 | #if defined(__FreeBSD__) || defined(__DragonFly__) |
| 15 | #include <elf-hints.h> |
15 | #include <elf-hints.h> |
| 16 | #endif |
16 | #endif |
| 17 | |
17 | |
| 18 | static const char *rcsid = "$Id: scanelf.c,v 1.143 2006/05/11 05:44:22 solar Exp $"; |
18 | static const char *rcsid = "$Id: scanelf.c,v 1.144 2006/05/14 03:40:33 solar Exp $"; |
| 19 | #define argv0 "scanelf" |
19 | #define argv0 "scanelf" |
| 20 | |
20 | |
| 21 | #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') |
21 | #define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') |
| 22 | |
22 | |
| 23 | #define do_state(option, flag) \ |
23 | #define do_state(option, flag) \ |
| … | |
… | |
| 981 | goto skip_this_sym##B; \ |
981 | goto skip_this_sym##B; \ |
| 982 | ++this_sym; \ |
982 | ++this_sym; \ |
| 983 | } \ |
983 | } \ |
| 984 | /* ok, lets compare the name now */ \ |
984 | /* ok, lets compare the name now */ \ |
| 985 | if ((strncmp(this_sym, symname, (next_sym-this_sym)) == 0 && symname[next_sym-this_sym] == '\0') || \ |
985 | if ((strncmp(this_sym, symname, (next_sym-this_sym)) == 0 && symname[next_sym-this_sym] == '\0') || \ |
| 986 | (strcmp(symname, versioned_symname) == 0)) { \ |
986 | (strncmp(symname, versioned_symname, strlen(versioned_symname)) == 0)) { \ |
| 987 | if (be_semi_verbose) { \ |
987 | if (be_semi_verbose) { \ |
| 988 | char buf[126]; \ |
988 | char buf[126]; \ |
| 989 | snprintf(buf, sizeof(buf), "%lX %s %s", \ |
989 | snprintf(buf, sizeof(buf), "%lX %s %s", \ |
| 990 | (unsigned long)sym->st_size, get_elfstttype(sym->st_info), this_sym); \ |
990 | (unsigned long)sym->st_size, get_elfstttype(sym->st_info), this_sym); \ |
| 991 | ret = buf; \ |
991 | ret = buf; \ |