/[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.250 Revision 1.251
1/* 1/*
2 * Copyright 2003-2012 Gentoo Foundation 2 * Copyright 2003-2012 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.250 2012/11/04 08:25:41 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.251 2012/11/10 09:43:00 vapier Exp $
5 * 5 *
6 * Copyright 2003-2012 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2012 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2012 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2012 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10static const char rcsid[] = "$Id: scanelf.c,v 1.250 2012/11/04 08:25:41 vapier Exp $"; 10static const char rcsid[] = "$Id: scanelf.c,v 1.251 2012/11/10 09:43:00 vapier Exp $";
11const char argv0[] = "scanelf"; 11const char 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 == '+')
1020 *found_interp = 1; \ 1020 *found_interp = 1; \
1021 return (be_wewy_wewy_quiet ? NULL : elf->data + EGET(strtbl->sh_offset)); \ 1021 return (be_wewy_wewy_quiet ? NULL : elf->data + EGET(strtbl->sh_offset)); \
1022 } 1022 }
1023 SHOW_INTERP(32) 1023 SHOW_INTERP(32)
1024 SHOW_INTERP(64) 1024 SHOW_INTERP(64)
1025 } else {
1026 /* Walk all the program headers to find the PT_INTERP */
1027#define SHOW_PT_INTERP(B) \
1028 if (elf->elf_class == ELFCLASS ## B) { \
1029 unsigned long i; \
1030 Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \
1031 Elf ## B ## _Phdr *phdr = PHDR ## B (elf->phdr); \
1032 for (i = 0; i < EGET(ehdr->e_phnum); i++) { \
1033 if (EGET(phdr[i].p_type) != PT_INTERP) \
1034 continue; \
1035 *found_interp = 1; \
1036 return (be_wewy_wewy_quiet ? NULL : elf->data + EGET(phdr[i].p_offset)); \
1037 } \
1025 } 1038 }
1039 SHOW_PT_INTERP(32)
1040 SHOW_PT_INTERP(64)
1041 }
1042
1026 return NULL; 1043 return NULL;
1027} 1044}
1028static char *scanelf_file_bind(elfobj *elf, char *found_bind) 1045static char *scanelf_file_bind(elfobj *elf, char *found_bind)
1029{ 1046{
1030 unsigned long i; 1047 unsigned long i;

Legend:
Removed from v.1.250  
changed lines
  Added in v.1.251

  ViewVC Help
Powered by ViewVC 1.1.20