/[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.110 Revision 1.111
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/scanelf.c,v 1.110 2006/01/20 00:21:03 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.111 2006/01/20 00:23:32 vapier 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
10#include "paxinc.h" 10#include "paxinc.h"
11 11
12static const char *rcsid = "$Id: scanelf.c,v 1.110 2006/01/20 00:21:03 vapier Exp $"; 12static const char *rcsid = "$Id: scanelf.c,v 1.111 2006/01/20 00:23:32 vapier Exp $";
13#define argv0 "scanelf" 13#define argv0 "scanelf"
14 14
15#define IS_MODIFIER(c) (c == '%' || c == '#') 15#define IS_MODIFIER(c) (c == '%' || c == '#')
16 16
17 17
332 } else \ 332 } else \
333 *found_textrels = 1; \ 333 *found_textrels = 1; \
334 /* locate this relocation symbol name */ \ 334 /* locate this relocation symbol name */ \
335 sym = SYM ## B (elf->data + EGET(symtab->sh_offset)); \ 335 sym = SYM ## B (elf->data + EGET(symtab->sh_offset)); \
336 if ((void*)sym > (void*)elf->data) { \ 336 if ((void*)sym > (void*)elf->data) { \
337 warn("corrupt ELF symbol"); \ 337 warn("%s: corrupt ELF symbol", elf->filename); \
338 continue; \ 338 continue; \
339 } \ 339 } \
340 sym_max = ELF ## B ## _R_SYM(r_info); \ 340 sym_max = ELF ## B ## _R_SYM(r_info); \
341 if (sym_max * EGET(symtab->sh_entsize) < symtab->sh_size) \ 341 if (sym_max * EGET(symtab->sh_entsize) < symtab->sh_size) \
342 sym += sym_max; \ 342 sym += sym_max; \
817 unsigned long cnt = EGET(symtab->sh_size) / EGET(symtab->sh_entsize); \ 817 unsigned long cnt = EGET(symtab->sh_size) / EGET(symtab->sh_entsize); \
818 char *symname; \ 818 char *symname; \
819 for (i = 0; i < cnt; ++i) { \ 819 for (i = 0; i < cnt; ++i) { \
820 if (sym->st_name) { \ 820 if (sym->st_name) { \
821 symname = (char *)(elf->data + EGET(strtab->sh_offset) + EGET(sym->st_name)); \ 821 symname = (char *)(elf->data + EGET(strtab->sh_offset) + EGET(sym->st_name)); \
822 if ((void*)symname > (void*)elf->data) { \
823 warn("%s: corrupt ELF symbols", elf->filename); \
824 continue; \
825 } \
822 if (*find_sym == '*') { \ 826 if (*find_sym == '*') { \
823 printf("%s(%s) %5lX %15s %s\n", \ 827 printf("%s(%s) %5lX %15s %s\n", \
824 ((*found_sym == 0) ? "\n\t" : "\t"), \ 828 ((*found_sym == 0) ? "\n\t" : "\t"), \
825 elf->base_filename, \ 829 elf->base_filename, \
826 (unsigned long)sym->st_size, \ 830 (unsigned long)sym->st_size, \

Legend:
Removed from v.1.110  
changed lines
  Added in v.1.111

  ViewVC Help
Powered by ViewVC 1.1.20