/[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.87 Revision 1.88
1/* 1/*
2 * Copyright 2003-2005 Gentoo Foundation 2 * Copyright 2003-2005 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.87 2005/09/30 03:30:19 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.88 2005/09/30 03:30:54 vapier Exp $
5 * 5 *
6 * Copyright 2003-2005 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2005 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2005 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2005 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
20#include <dirent.h> 20#include <dirent.h>
21#include <getopt.h> 21#include <getopt.h>
22#include <assert.h> 22#include <assert.h>
23#include "paxelf.h" 23#include "paxelf.h"
24 24
25static const char *rcsid = "$Id: scanelf.c,v 1.87 2005/09/30 03:30:19 vapier Exp $"; 25static const char *rcsid = "$Id: scanelf.c,v 1.88 2005/09/30 03:30:54 vapier Exp $";
26#define argv0 "scanelf" 26#define argv0 "scanelf"
27 27
28#define IS_MODIFIER(c) (c == '%' || c == '#') 28#define IS_MODIFIER(c) (c == '%' || c == '#')
29 29
30 30
299 sym += sym_max; \ 299 sym += sym_max; \
300 else \ 300 else \
301 sym = NULL; \ 301 sym = NULL; \
302 sym_max = EGET(symtab->sh_size) / EGET(symtab->sh_entsize); \ 302 sym_max = EGET(symtab->sh_size) / EGET(symtab->sh_entsize); \
303 /* show the raw details about this reloc */ \ 303 /* show the raw details about this reloc */ \
304 printf("\tTEXTREL %s: ", elf->base_filename); \ 304 printf(" %s: ", elf->base_filename); \
305 if (sym && sym->st_name) \ 305 if (sym && sym->st_name) \
306 printf("%s", (char*)(elf->data + EGET(strtab->sh_offset) + EGET(sym->st_name))); \ 306 printf("%s", (char*)(elf->data + EGET(strtab->sh_offset) + EGET(sym->st_name))); \
307 else \ 307 else \
308 printf("(NULL: fake?)"); \ 308 printf("(memory/fake?)"); \
309 printf(" [0x%lX]", (unsigned long)r_offset); \ 309 printf(" [0x%lX]", (unsigned long)r_offset); \
310 /* now try to find the closest symbol that this rel is probably in */ \ 310 /* now try to find the closest symbol that this rel is probably in */ \
311 sym = SYM ## B (elf->data + EGET(symtab->sh_offset)); \ 311 sym = SYM ## B (elf->data + EGET(symtab->sh_offset)); \
312 func = NULL; \ 312 func = NULL; \
313 offset_tmp = 0; \ 313 offset_tmp = 0; \
1052 puts("\nThe format modifiers for the -F option are:"); 1052 puts("\nThe format modifiers for the -F option are:");
1053 puts(" F Filename \tx PaX Flags \te STACK/RELRO"); 1053 puts(" F Filename \tx PaX Flags \te STACK/RELRO");
1054 puts(" t TEXTREL \tr RPATH \tn NEEDED"); 1054 puts(" t TEXTREL \tr RPATH \tn NEEDED");
1055 puts(" i INTERP \tb BIND \ts symbol"); 1055 puts(" i INTERP \tb BIND \ts symbol");
1056 puts(" N library \to Type \tT TEXTRELs"); 1056 puts(" N library \to Type \tT TEXTRELs");
1057 puts(" S SONAME");
1057 puts(" p filename (with search path removed)"); 1058 puts(" p filename (with search path removed)");
1058 puts(" f base filename"); 1059 puts(" f filename (short name/basename)");
1059 puts("Prefix each modifier with '%' (verbose) or '#' (silent)"); 1060 puts("Prefix each modifier with '%' (verbose) or '#' (silent)");
1060 1061
1061 exit(status); 1062 exit(status);
1062} 1063}
1063 1064

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.88

  ViewVC Help
Powered by ViewVC 1.1.20