/[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.272 Revision 1.273
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.272 2015/02/22 00:54:34 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.273 2015/02/22 01:38:28 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.272 2015/02/22 00:54:34 vapier Exp $"; 10static const char rcsid[] = "$Id: scanelf.c,v 1.273 2015/02/22 01:38:28 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 == '+')
227 /* 227 /*
228 * damn, they're really going to make us work for it huh? 228 * damn, they're really going to make us work for it huh?
229 * reconstruct the section header info out of the dynamic 229 * reconstruct the section header info out of the dynamic
230 * tags so we can see what symbols this guy uses at runtime. 230 * tags so we can see what symbols this guy uses at runtime.
231 */ 231 */
232 if (!elf->phdr)
233 return;
232#define GET_SYMTABS_DT(B) \ 234#define GET_SYMTABS_DT(B) \
233 if (elf->elf_class == ELFCLASS ## B) { \ 235 if (elf->elf_class == ELFCLASS ## B) { \
234 size_t i; \ 236 size_t i; \
235 static Elf ## B ## _Shdr sym_shdr, str_shdr; \ 237 static Elf ## B ## _Shdr sym_shdr, str_shdr; \
236 Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \ 238 Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \
1080 *found_interp = 1; \ 1082 *found_interp = 1; \
1081 return (be_wewy_wewy_quiet ? NULL : elf->data + EGET(strtbl->sh_offset)); \ 1083 return (be_wewy_wewy_quiet ? NULL : elf->data + EGET(strtbl->sh_offset)); \
1082 } 1084 }
1083 SHOW_INTERP(32) 1085 SHOW_INTERP(32)
1084 SHOW_INTERP(64) 1086 SHOW_INTERP(64)
1085 } else { 1087 } else if (elf->phdr) {
1086 /* Walk all the program headers to find the PT_INTERP */ 1088 /* Walk all the program headers to find the PT_INTERP */
1087#define SHOW_PT_INTERP(B) \ 1089#define SHOW_PT_INTERP(B) \
1088 if (elf->elf_class == ELFCLASS ## B) { \ 1090 if (elf->elf_class == ELFCLASS ## B) { \
1089 unsigned long i; \ 1091 unsigned long i; \
1090 Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \ 1092 Elf ## B ## _Ehdr *ehdr = EHDR ## B (elf->ehdr); \

Legend:
Removed from v.1.272  
changed lines
  Added in v.1.273

  ViewVC Help
Powered by ViewVC 1.1.20