/[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.257 Revision 1.258
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/Attic/scanelf.c,v 1.257 2013/04/10 22:27:20 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.258 2013/04/16 16:22:31 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.257 2013/04/10 22:27:20 vapier Exp $"; 10static const char rcsid[] = "$Id: scanelf.c,v 1.258 2013/04/16 16:22:31 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 == '+')
1043} 1043}
1044static const char *scanelf_file_bind(elfobj *elf, char *found_bind) 1044static const char *scanelf_file_bind(elfobj *elf, char *found_bind)
1045{ 1045{
1046 unsigned long i; 1046 unsigned long i;
1047 struct stat s; 1047 struct stat s;
1048 char dynamic = 0; 1048 bool dynamic = false;
1049 1049
1050 if (!show_bind) return NULL; 1050 if (!show_bind) return NULL;
1051 if (!elf->phdr) return NULL; 1051 if (!elf->phdr) return NULL;
1052 1052
1053#define SHOW_BIND(B) \ 1053#define SHOW_BIND(B) \
1056 Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \ 1056 Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \
1057 Elf ## B ## _Phdr *phdr = PHDR ## B (elf->phdr); \ 1057 Elf ## B ## _Phdr *phdr = PHDR ## B (elf->phdr); \
1058 Elf ## B ## _Off offset; \ 1058 Elf ## B ## _Off offset; \
1059 for (i = 0; i < EGET(ehdr->e_phnum); i++) { \ 1059 for (i = 0; i < EGET(ehdr->e_phnum); i++) { \
1060 if (EGET(phdr[i].p_type) != PT_DYNAMIC || EGET(phdr[i].p_filesz) == 0) continue; \ 1060 if (EGET(phdr[i].p_type) != PT_DYNAMIC || EGET(phdr[i].p_filesz) == 0) continue; \
1061 dynamic = 1; \ 1061 dynamic = true; \
1062 offset = EGET(phdr[i].p_offset); \ 1062 offset = EGET(phdr[i].p_offset); \
1063 if (offset >= elf->len - sizeof(Elf ## B ## _Dyn)) continue; \ 1063 if (offset >= elf->len - sizeof(Elf ## B ## _Dyn)) continue; \
1064 dyn = DYN ## B (elf->vdata + offset); \ 1064 dyn = DYN ## B (elf->vdata + offset); \
1065 while (EGET(dyn->d_tag) != DT_NULL) { \ 1065 while (EGET(dyn->d_tag) != DT_NULL) { \
1066 if (EGET(dyn->d_tag) == DT_BIND_NOW || \ 1066 if (EGET(dyn->d_tag) == DT_BIND_NOW || \

Legend:
Removed from v.1.257  
changed lines
  Added in v.1.258

  ViewVC Help
Powered by ViewVC 1.1.20