OLD | NEW |
(Empty) | |
| 1 // -*- mode: ObjC -*- |
| 2 |
| 3 // This file is part of class-dump, a utility for examining the Objective-C seg
ment of Mach-O files. |
| 4 // Copyright (C) 1997-1998, 2000-2001, 2004-2010 Steve Nygard. |
| 5 |
| 6 #import "CDRelocationInfo.h" |
| 7 |
| 8 @implementation CDRelocationInfo |
| 9 |
| 10 - (id)initWithInfo:(struct relocation_info)info; |
| 11 { |
| 12 if ([super init] == nil) |
| 13 return nil; |
| 14 |
| 15 rinfo = info; |
| 16 |
| 17 return self; |
| 18 } |
| 19 |
| 20 - (NSUInteger)offset; |
| 21 { |
| 22 return rinfo.r_address; |
| 23 } |
| 24 |
| 25 - (CDRelocationSize)size; |
| 26 { |
| 27 return rinfo.r_length; |
| 28 } |
| 29 |
| 30 - (uint32_t)symbolnum; |
| 31 { |
| 32 return rinfo.r_symbolnum; |
| 33 } |
| 34 |
| 35 - (BOOL)isExtern; |
| 36 { |
| 37 return rinfo.r_extern == 1; |
| 38 } |
| 39 |
| 40 - (NSString *)description; |
| 41 { |
| 42 return [NSString stringWithFormat:@"<%@:%p> addr/off: %08x, sym #: %5u, pcre
l? %u, len: %u, extern? %u, type: %x", |
| 43 NSStringFromClass([self class]), self, |
| 44 rinfo.r_address, rinfo.r_symbolnum, rinfo.r_pcrel, rinfo.r_
length, rinfo.r_extern, rinfo.r_type]; |
| 45 } |
| 46 |
| 47 @end |
OLD | NEW |