/[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.274 Revision 1.275
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.274 2015/02/22 02:27:39 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.275 2015/02/24 06:58:39 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.274 2015/02/22 02:27:39 vapier Exp $"; 10static const char rcsid[] = "$Id: scanelf.c,v 1.275 2015/02/24 06:58:39 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 == '+')
287 Elf32_Word b, nbuckets = EGET(hashtbl[0]); \ 287 Elf32_Word b, nbuckets = EGET(hashtbl[0]); \
288 Elf32_Word nchains = EGET(hashtbl[1]); \ 288 Elf32_Word nchains = EGET(hashtbl[1]); \
289 Elf32_Word *buckets = &hashtbl[2]; \ 289 Elf32_Word *buckets = &hashtbl[2]; \
290 Elf32_Word *chains = &buckets[nbuckets]; \ 290 Elf32_Word *chains = &buckets[nbuckets]; \
291 Elf32_Word sym_idx; \ 291 Elf32_Word sym_idx; \
292 Elf32_Word chained; \
292 \ 293 \
293 for (b = 0; b < nbuckets; ++b) { \ 294 for (b = 0; b < nbuckets; ++b) { \
294 if (!buckets[b]) \ 295 if (!buckets[b]) \
295 continue; \ 296 continue; \
296 for (sym_idx = buckets[b]; sym_idx < nchains && sym_idx; sym_idx = chains[sym_idx]) \ 297 for (sym_idx = buckets[b], chained = 0; \
298 sym_idx < nchains && sym_idx && chained <= nchains; \
299 sym_idx = chains[sym_idx], ++chained) { \
297 if (max_sym_idx < sym_idx) \ 300 if (max_sym_idx < sym_idx) \
298 max_sym_idx = sym_idx; \ 301 max_sym_idx = sym_idx; \
302 } \
303 if (chained > nchains) { \
304 warnf("corrupt ELF bucket"); \
305 break; \
306 } \
299 } \ 307 } \
300 ESET(sym_shdr.sh_size, sym_shdr.sh_entsize * max_sym_idx); \ 308 ESET(sym_shdr.sh_size, sym_shdr.sh_entsize * max_sym_idx); \
301 } \ 309 } \
302 \ 310 \
303 if (vsym >= vaddr && vsym < vaddr + filesz) { \ 311 if (vsym >= vaddr && vsym < vaddr + filesz) { \

Legend:
Removed from v.1.274  
changed lines
  Added in v.1.275

  ViewVC Help
Powered by ViewVC 1.1.20