/[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.208 Revision 1.209
1/* 1/*
2 * Copyright 2003-2007 Gentoo Foundation 2 * Copyright 2003-2007 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.208 2009/01/31 17:58:37 grobian Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.209 2009/03/15 08:53:29 vapier Exp $
5 * 5 *
6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10static const char *rcsid = "$Id: scanelf.c,v 1.208 2009/01/31 17:58:37 grobian Exp $"; 10static const char *rcsid = "$Id: scanelf.c,v 1.209 2009/03/15 08:53:29 vapier Exp $";
11const char * const argv0 = "scanelf"; 11const char * const 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 == '+')
473 printf(" [0x%lX]\n", (unsigned long)offset_tmp); \ 473 printf(" [0x%lX]\n", (unsigned long)offset_tmp); \
474 if (be_verbose && has_objdump) { \ 474 if (be_verbose && has_objdump) { \
475 Elf ## B ## _Addr end_addr = offset_tmp + EGET(func->st_size); \ 475 Elf ## B ## _Addr end_addr = offset_tmp + EGET(func->st_size); \
476 char *sysbuf; \ 476 char *sysbuf; \
477 size_t syslen; \ 477 size_t syslen; \
478 int sysret; \
478 const char sysfmt[] = "objdump -r -R -d -w -l --start-address=0x%lX --stop-address=0x%lX %s | grep --color -i -C 3 '.*[[:space:]]%lX:[[:space:]]*R_.*'\n"; \ 479 const char sysfmt[] = "objdump -r -R -d -w -l --start-address=0x%lX --stop-address=0x%lX %s | grep --color -i -C 3 '.*[[:space:]]%lX:[[:space:]]*R_.*'\n"; \
479 syslen = sizeof(sysfmt) + strlen(elf->filename) + 3 * sizeof(unsigned long) + 1; \ 480 syslen = sizeof(sysfmt) + strlen(elf->filename) + 3 * sizeof(unsigned long) + 1; \
480 sysbuf = xmalloc(syslen); \ 481 sysbuf = xmalloc(syslen); \
481 if (end_addr < r_offset) \ 482 if (end_addr < r_offset) \
482 /* not uncommon when things are optimized out */ \ 483 /* not uncommon when things are optimized out */ \
485 (unsigned long)offset_tmp, \ 486 (unsigned long)offset_tmp, \
486 (unsigned long)end_addr, \ 487 (unsigned long)end_addr, \
487 elf->filename, \ 488 elf->filename, \
488 (unsigned long)r_offset); \ 489 (unsigned long)r_offset); \
489 fflush(stdout); \ 490 fflush(stdout); \
490 system(sysbuf); \ 491 sysret = system(sysbuf); \
491 fflush(stdout); \ 492 fflush(stdout); \
492 free(sysbuf); \ 493 free(sysbuf); \
493 } \ 494 } \
494 } \ 495 } \
495 } } 496 } }

Legend:
Removed from v.1.208  
changed lines
  Added in v.1.209

  ViewVC Help
Powered by ViewVC 1.1.20