/[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.258 Revision 1.259
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.258 2013/04/16 16:22:31 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.259 2013/08/14 21:09:57 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.258 2013/04/16 16:22:31 vapier Exp $"; 10static const char rcsid[] = "$Id: scanelf.c,v 1.259 2013/08/14 21:09:57 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 == '+')
377 Elf ## B ## _Shdr *shdr = SHDR ## B (elf->shdr); \ 377 Elf ## B ## _Shdr *shdr = SHDR ## B (elf->shdr); \
378 Elf ## B ## _Shdr *strtbl = shdr + EGET(ehdr->e_shstrndx); \ 378 Elf ## B ## _Shdr *strtbl = shdr + EGET(ehdr->e_shstrndx); \
379 char *str; \ 379 char *str; \
380 if ((void*)strtbl > elf->data_end) \ 380 if ((void*)strtbl > elf->data_end) \
381 goto skip_this_shdr##B; \ 381 goto skip_this_shdr##B; \
382 /* let's flag -w/+x object files since the final ELF will most likely
383 * need write access to the stack (who doesn't !?). so the combined
384 * output will bring in +w automatically and that's bad.
385 */
382 check_flags = SHF_WRITE|SHF_EXECINSTR; \ 386 check_flags = /*SHF_WRITE|*/SHF_EXECINSTR; \
383 for (i = 0; i < EGET(ehdr->e_shnum); ++i) { \ 387 for (i = 0; i < EGET(ehdr->e_shnum); ++i) { \
384 if (EGET(shdr[i].sh_type) != SHT_PROGBITS) continue; \ 388 if (EGET(shdr[i].sh_type) != SHT_PROGBITS) continue; \
385 offset = EGET(strtbl->sh_offset) + EGET(shdr[i].sh_name); \ 389 offset = EGET(strtbl->sh_offset) + EGET(shdr[i].sh_name); \
386 str = elf->data + offset; \ 390 str = elf->data + offset; \
387 if (str > elf->data + offset + sizeof(NOTE_GNU_STACK)) continue; \ 391 if (str > elf->data + offset + sizeof(NOTE_GNU_STACK)) continue; \

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

  ViewVC Help
Powered by ViewVC 1.1.20