/[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.144 Revision 1.145
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/Attic/scanelf.c,v 1.144 2006/05/14 03:40:33 solar Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.145 2006/05/14 19:08:56 kevquinn 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
18static const char *rcsid = "$Id: scanelf.c,v 1.144 2006/05/14 03:40:33 solar Exp $"; 18static const char *rcsid = "$Id: scanelf.c,v 1.145 2006/05/14 19:08:56 kevquinn 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) \
82static char gmatch = 0; 82static char gmatch = 0;
83static char use_ldcache = 0; 83static char use_ldcache = 0;
84 84
85static char **qa_textrels = NULL; 85static char **qa_textrels = NULL;
86static char **qa_execstack = NULL; 86static char **qa_execstack = NULL;
87static char **qa_wx_load = NULL;
87 88
88int match_bits = 0; 89int match_bits = 0;
89caddr_t ldcache = 0; 90caddr_t ldcache = 0;
90size_t ldcache_size = 0; 91size_t ldcache_size = 0;
91unsigned long setpax = 0UL; 92unsigned long setpax = 0UL;
285 offset = 4; \ 286 offset = 4; \
286 check_flags = PF_X; \ 287 check_flags = PF_X; \
287 } else if (EGET(phdr[i].p_type) == PT_LOAD) { \ 288 } else if (EGET(phdr[i].p_type) == PT_LOAD) { \
288 if (ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC) \ 289 if (ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC) \
289 if (multi_load++ > max_pt_load) warnf("%s: more than %i PT_LOAD's !?", elf->filename, max_pt_load); \ 290 if (multi_load++ > max_pt_load) warnf("%s: more than %i PT_LOAD's !?", elf->filename, max_pt_load); \
291 if (!file_matches_list(elf->filename, qa_wx_load)) {\
290 found = found_load; \ 292 found = found_load; \
291 offset = 8; \ 293 offset = 8; \
292 check_flags = PF_W|PF_X; \ 294 check_flags = PF_W|PF_X; \
295 } else continue; \
293 } else \ 296 } else \
294 continue; \ 297 continue; \
295 flags = EGET(phdr[i].p_flags); \ 298 flags = EGET(phdr[i].p_flags); \
296 if (be_quiet && ((flags & check_flags) != check_flags)) \ 299 if (be_quiet && ((flags & check_flags) != check_flags)) \
297 continue; \ 300 continue; \
1868} 1871}
1869 1872
1870static void parseenv() { 1873static void parseenv() {
1871 qa_textrels=get_split_env("QA_TEXTRELS"); 1874 qa_textrels=get_split_env("QA_TEXTRELS");
1872 qa_execstack=get_split_env("QA_EXECSTACK"); 1875 qa_execstack=get_split_env("QA_EXECSTACK");
1876 qa_wx_load=get_split_env("QA_WX_LOAD");
1873} 1877}
1874 1878
1875 1879
1876 1880
1877int main(int argc, char *argv[]) 1881int main(int argc, char *argv[])

Legend:
Removed from v.1.144  
changed lines
  Added in v.1.145

  ViewVC Help
Powered by ViewVC 1.1.20