@@ -263,7 +263,6 @@ InternalInitialiseSymtabs (
263263 BOOLEAN Result ;
264264
265265 MACH_NLIST_ANY * SymbolTable ;
266- MACH_NLIST_ANY * IndirectSymtab ;
267266 MACH_RELOCATION_INFO * LocalRelocations ;
268267 MACH_RELOCATION_INFO * ExternRelocations ;
269268
@@ -310,7 +309,6 @@ InternalInitialiseSymtabs (
310309 }
311310
312311 SymbolTable = (MACH_NLIST_ANY * )Tmp ;
313- IndirectSymtab = NULL ;
314312 LocalRelocations = NULL ;
315313 ExternRelocations = NULL ;
316314
@@ -342,29 +340,6 @@ InternalInitialiseSymtabs (
342340 return FALSE;
343341 }
344342
345- //
346- // We additionally check for offset validity here, as KC kexts have some garbage
347- // in their DySymtab, but it is "valid" for symbols.
348- //
349- if ((DySymtab -> NumIndirectSymbols > 0 ) && (DySymtab -> IndirectSymbolsOffset != 0 )) {
350- Result = BaseOverflowMulAddU32 (
351- DySymtab -> NumIndirectSymbols ,
352- Context -> Is32Bit ? sizeof (MACH_NLIST ) : sizeof (MACH_NLIST_64 ),
353- DySymtab -> IndirectSymbolsOffset ,
354- & OffsetTop
355- );
356- if (Result || (OffsetTop > FileSize )) {
357- return FALSE;
358- }
359-
360- Tmp = (VOID * )(FileDataAddress + DySymtab -> IndirectSymbolsOffset );
361- if (!(Context -> Is32Bit ? BASE_TYPE_ALIGNED (MACH_NLIST , Tmp ) : BASE_TYPE_ALIGNED (MACH_NLIST_64 , Tmp ))) {
362- return FALSE;
363- }
364-
365- IndirectSymtab = (MACH_NLIST_ANY * )Tmp ;
366- }
367-
368343 if ((DySymtab -> NumOfLocalRelocations > 0 ) && (DySymtab -> LocalRelocationsOffset != 0 )) {
369344 Result = BaseOverflowMulAddU32 (
370345 DySymtab -> NumOfLocalRelocations ,
@@ -411,10 +386,9 @@ InternalInitialiseSymtabs (
411386 Context -> StringTable = StringTable ;
412387 Context -> DySymtab = DySymtab ;
413388
414- Context -> LocalRelocations = LocalRelocations ;
415- Context -> ExternRelocations = ExternRelocations ;
416- Context -> SymbolTable = SymbolTable ;
417- Context -> IndirectSymbolTable = IndirectSymtab ;
389+ Context -> LocalRelocations = LocalRelocations ;
390+ Context -> ExternRelocations = ExternRelocations ;
391+ Context -> SymbolTable = SymbolTable ;
418392
419393 return TRUE;
420394}
@@ -555,19 +529,6 @@ MachoGetSymbolTable (
555529 );
556530}
557531
558- UINT32
559- MachoGetIndirectSymbolTable (
560- IN OUT OC_MACHO_CONTEXT * Context ,
561- OUT CONST MACH_NLIST_ANY * * SymbolTable
562- )
563- {
564- ASSERT (Context != NULL );
565-
566- return Context -> Is32Bit ?
567- MachoGetIndirectSymbolTable32 (Context , (CONST MACH_NLIST * * )SymbolTable ) :
568- MachoGetIndirectSymbolTable64 (Context , (CONST MACH_NLIST_64 * * )SymbolTable );
569- }
570-
571532UINT64
572533MachoRuntimeGetEntryAddress (
573534 IN VOID * Image
0 commit comments