elfclass.h (191739) | elfclass.h (226048) |
---|---|
1/* 2 * Copyright (c) Christos Zoulas 2008. 3 * All Rights Reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 u.l = 1; 31 (void)memcpy(&elfhdr, buf, sizeof elfhdr); 32 swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA]; 33 34 type = elf_getu16(swap, elfhdr.e_type); 35 switch (type) { 36#ifdef ELFCORE 37 case ET_CORE: | 1/* 2 * Copyright (c) Christos Zoulas 2008. 3 * All Rights Reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 u.l = 1; 31 (void)memcpy(&elfhdr, buf, sizeof elfhdr); 32 swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA]; 33 34 type = elf_getu16(swap, elfhdr.e_type); 35 switch (type) { 36#ifdef ELFCORE 37 case ET_CORE: |
38 flags |= FLAGS_IS_CORE; |
|
38 if (dophn_core(ms, clazz, swap, fd, 39 (off_t)elf_getu(swap, elfhdr.e_phoff), 40 elf_getu16(swap, elfhdr.e_phnum), 41 (size_t)elf_getu16(swap, elfhdr.e_phentsize), 42 fsize, &flags) == -1) 43 return -1; 44 break; 45#endif --- 7 unchanged lines hidden (view full) --- 53 == -1) 54 return -1; 55 /*FALLTHROUGH*/ 56 case ET_REL: 57 if (doshn(ms, clazz, swap, fd, 58 (off_t)elf_getu(swap, elfhdr.e_shoff), 59 elf_getu16(swap, elfhdr.e_shnum), 60 (size_t)elf_getu16(swap, elfhdr.e_shentsize), | 39 if (dophn_core(ms, clazz, swap, fd, 40 (off_t)elf_getu(swap, elfhdr.e_phoff), 41 elf_getu16(swap, elfhdr.e_phnum), 42 (size_t)elf_getu16(swap, elfhdr.e_phentsize), 43 fsize, &flags) == -1) 44 return -1; 45 break; 46#endif --- 7 unchanged lines hidden (view full) --- 54 == -1) 55 return -1; 56 /*FALLTHROUGH*/ 57 case ET_REL: 58 if (doshn(ms, clazz, swap, fd, 59 (off_t)elf_getu(swap, elfhdr.e_shoff), 60 elf_getu16(swap, elfhdr.e_shnum), 61 (size_t)elf_getu16(swap, elfhdr.e_shentsize), |
61 &flags, 62 elf_getu16(swap, elfhdr.e_machine)) == -1) | 62 fsize, &flags, elf_getu16(swap, elfhdr.e_machine)) == -1) |
63 return -1; 64 break; 65 66 default: 67 break; 68 } 69 return 1; | 63 return -1; 64 break; 65 66 default: 67 break; 68 } 69 return 1; |