@@ -3661,10 +3661,6 @@ struct class_ro32_t {
3661
3661
#define RO_ROOT (1 << 1 )
3662
3662
#define RO_HAS_CXX_STRUCTORS (1 << 2 )
3663
3663
3664
- /* Values for method_list{64,32}_t->entsize */
3665
- #define ML_HAS_RELATIVE_PTRS (1 << 31 )
3666
- #define ML_ENTSIZE_MASK 0xFFFF
3667
-
3668
3664
struct method_list64_t {
3669
3665
uint32_t entsize;
3670
3666
uint32_t count;
@@ -3689,12 +3685,6 @@ struct method32_t {
3689
3685
uint32_t imp; /* IMP (32-bit pointer) */
3690
3686
};
3691
3687
3692
- struct method_relative_t {
3693
- int32_t name; /* SEL (32-bit relative) */
3694
- int32_t types; /* const char * (32-bit relative) */
3695
- int32_t imp; /* IMP (32-bit relative) */
3696
- };
3697
-
3698
3688
struct protocol_list64_t {
3699
3689
uint64_t count; /* uintptr_t (a 64-bit value) */
3700
3690
/* struct protocol64_t * list[0]; These pointers follow inline */
@@ -3996,12 +3986,6 @@ inline void swapStruct(struct method32_t &m) {
3996
3986
sys::swapByteOrder (m.imp );
3997
3987
}
3998
3988
3999
- inline void swapStruct (struct method_relative_t &m) {
4000
- sys::swapByteOrder (m.name );
4001
- sys::swapByteOrder (m.types );
4002
- sys::swapByteOrder (m.imp );
4003
- }
4004
-
4005
3989
inline void swapStruct (struct protocol_list64_t &pl) {
4006
3990
sys::swapByteOrder (pl.count );
4007
3991
}
@@ -4456,84 +4440,6 @@ static void print_layout_map32(uint32_t p, struct DisassembleInfo *info) {
4456
4440
print_layout_map (layout_map, left);
4457
4441
}
4458
4442
4459
- static void print_relative_method_list (uint32_t structSizeAndFlags,
4460
- uint32_t structCount, uint64_t p,
4461
- struct DisassembleInfo *info,
4462
- const char *indent,
4463
- uint32_t pointerBits) {
4464
- struct method_relative_t m;
4465
- const char *r, *name;
4466
- uint32_t offset, xoffset, left, i;
4467
- SectionRef S, xS;
4468
-
4469
- assert (((structSizeAndFlags & ML_HAS_RELATIVE_PTRS) != 0 ) &&
4470
- " expected structSizeAndFlags to have ML_HAS_RELATIVE_PTRS flag" );
4471
-
4472
- outs () << indent << " \t\t entsize "
4473
- << (structSizeAndFlags & ML_ENTSIZE_MASK) << " (relative) \n " ;
4474
- outs () << indent << " \t\t count " << structCount << " \n " ;
4475
-
4476
- for (i = 0 ; i < structCount; i++) {
4477
- r = get_pointer_64 (p, offset, left, S, info);
4478
- memset (&m, ' \0 ' , sizeof (struct method_relative_t ));
4479
- if (left < sizeof (struct method_relative_t )) {
4480
- memcpy (&m, r, left);
4481
- outs () << indent << " (method_t extends past the end of the section)\n " ;
4482
- } else
4483
- memcpy (&m, r, sizeof (struct method_relative_t ));
4484
- if (info->O ->isLittleEndian () != sys::IsLittleEndianHost)
4485
- swapStruct (m);
4486
-
4487
- outs () << indent << " \t\t name " << format (" 0x%" PRIx32, m.name );
4488
- uint64_t relNameRefVA = p + offsetof (struct method_relative_t , name);
4489
- uint64_t absNameRefVA = relNameRefVA + m.name ;
4490
- outs () << " (" << format (" 0x%" PRIx32, absNameRefVA) << " )" ;
4491
-
4492
- // since this is a relative list, absNameRefVA is the address of the
4493
- // __objc_selrefs entry, so a pointer, not the actual name
4494
- const char *nameRefPtr =
4495
- get_pointer_64 (absNameRefVA, xoffset, left, xS, info);
4496
- if (nameRefPtr) {
4497
- uint32_t pointerSize = pointerBits / CHAR_BIT;
4498
- if (left < pointerSize)
4499
- outs () << indent << " (nameRefPtr extends past the end of the section)" ;
4500
- else {
4501
- if (pointerSize == 64 ) {
4502
- name = get_pointer_64 (*reinterpret_cast <const uint64_t *>(nameRefPtr),
4503
- xoffset, left, xS, info);
4504
- } else {
4505
- name = get_pointer_32 (*reinterpret_cast <const uint32_t *>(nameRefPtr),
4506
- xoffset, left, xS, info);
4507
- }
4508
- if (name != nullptr )
4509
- outs () << format (" %.*s" , left, name);
4510
- }
4511
- }
4512
- outs () << " \n " ;
4513
-
4514
- outs () << indent << " \t\t types " << format (" 0x%" PRIx32, m.types );
4515
- uint64_t relTypesVA = p + offsetof (struct method_relative_t , types);
4516
- uint64_t absTypesVA = relTypesVA + m.types ;
4517
- outs () << " (" << format (" 0x%" PRIx32, absTypesVA) << " )" ;
4518
- name = get_pointer_32 (absTypesVA, xoffset, left, xS, info);
4519
- if (name != nullptr )
4520
- outs () << format (" %.*s" , left, name);
4521
- outs () << " \n " ;
4522
-
4523
- outs () << indent << " \t\t imp " << format (" 0x%" PRIx32, m.imp );
4524
- uint64_t relImpVA = p + offsetof (struct method_relative_t , imp);
4525
- uint64_t absImpVA = relImpVA + m.imp ;
4526
- outs () << " (" << format (" 0x%" PRIx32, absImpVA) << " )" ;
4527
- name = GuessSymbolName (absImpVA, info->AddrMap );
4528
- if (name != nullptr )
4529
- outs () << " " << name;
4530
- outs () << " \n " ;
4531
-
4532
- p += sizeof (struct method_relative_t );
4533
- offset += sizeof (struct method_relative_t );
4534
- }
4535
- }
4536
-
4537
4443
static void print_method_list64_t (uint64_t p, struct DisassembleInfo *info,
4538
4444
const char *indent) {
4539
4445
struct method_list64_t ml;
@@ -4555,17 +4461,10 @@ static void print_method_list64_t(uint64_t p, struct DisassembleInfo *info,
4555
4461
memcpy (&ml, r, sizeof (struct method_list64_t ));
4556
4462
if (info->O ->isLittleEndian () != sys::IsLittleEndianHost)
4557
4463
swapStruct (ml);
4558
- p += sizeof (struct method_list64_t );
4559
-
4560
- if ((ml.entsize & ML_HAS_RELATIVE_PTRS) != 0 ) {
4561
- print_relative_method_list (ml.entsize , ml.count , p, info, indent,
4562
- /* pointerBits=*/ 64 );
4563
- return ;
4564
- }
4565
-
4566
4464
outs () << indent << " \t\t entsize " << ml.entsize << " \n " ;
4567
4465
outs () << indent << " \t\t count " << ml.count << " \n " ;
4568
4466
4467
+ p += sizeof (struct method_list64_t );
4569
4468
offset += sizeof (struct method_list64_t );
4570
4469
for (i = 0 ; i < ml.count ; i++) {
4571
4470
r = get_pointer_64 (p, offset, left, S, info);
@@ -4653,17 +4552,10 @@ static void print_method_list32_t(uint64_t p, struct DisassembleInfo *info,
4653
4552
memcpy (&ml, r, sizeof (struct method_list32_t ));
4654
4553
if (info->O ->isLittleEndian () != sys::IsLittleEndianHost)
4655
4554
swapStruct (ml);
4656
- p += sizeof (struct method_list32_t );
4657
-
4658
- if ((ml.entsize & ML_HAS_RELATIVE_PTRS) != 0 ) {
4659
- print_relative_method_list (ml.entsize , ml.count , p, info, indent,
4660
- /* pointerBits=*/ 32 );
4661
- return ;
4662
- }
4663
-
4664
4555
outs () << indent << " \t\t entsize " << ml.entsize << " \n " ;
4665
4556
outs () << indent << " \t\t count " << ml.count << " \n " ;
4666
4557
4558
+ p += sizeof (struct method_list32_t );
4667
4559
offset += sizeof (struct method_list32_t );
4668
4560
for (i = 0 ; i < ml.count ; i++) {
4669
4561
r = get_pointer_32 (p, offset, left, S, info);
0 commit comments