+sub collectDyldStuff_powerpc { # Note: Darwin/PowerPC only
+ local($chunk_label,$label,$cur_section,$section,$chunk,$alignment,$cur_alignment);
+
+ %DyldChunks = (); # NB: global table
+ %DyldChunksDefined = (); # NB: global table
+
+ $cur_section = '';
+ $section = '';
+ $label = '';
+ $chunk = '';
+ $alignment = '';
+ $cur_alignment = '';
+
+ while ( 1 ) {
+ $_ = <TMPI>;
+ if ( $_ eq '' || /^L(_.+)\$.+:/ ) {
+ if ( $label ne '' ) {
+ $DyldChunksDefined{$label} .= $section . $chunk_label . $alignment . $ chunk;
+ if( $section =~ s/\.data/\.non_lazy_symbol_pointer/ ) {
+ $chunk = "\t.indirect_symbol $label\n\t.long 0\n";
+ }
+ $DyldChunks{$label} .= $section . $chunk_label . $chunk;
+ # don't use $alignment, it's only needed for .data, which we change into .non_lazy_symbol_pointer
+ print STDERR "### dyld chunk: $label\n$section$alignment$chunk\n###\n" if $Dump_asm_splitting_info;
+ }
+ last if ($_ eq '');
+
+ $chunk = '';
+ $chunk_label = $_;
+ $label = $1;
+ $section = $cur_section;
+ $alignment = $cur_alignment;
+ print STDERR "label: $label\n" if $Dump_asm_splitting_info;
+ } elsif ( /^\s*\.(symbol_stub|picsymbol_stub|lazy_symbol_pointer|non_lazy_symbol_pointer|data)/ ) {
+ $cur_section = $_;
+ printf STDERR "section: $cur_section\n" if $Dump_asm_splitting_info;
+ $cur_alignment = ''
+ } elsif ( /^\s*\.section\s+__TEXT,__symbol_stub1,symbol_stubs,pure_instructions,\d+/ ) {
+ $cur_section = $_;
+ printf STDERR "section: $cur_section\n" if $Dump_asm_splitting_info;
+ $cur_alignment = ''
+ } elsif ( /^\s*\.align.*/ ) {
+ $cur_alignment = $_;
+ printf STDERR "alignment: $cur_alignment\n" if $Dump_asm_splitting_info;
+ } else {
+ $chunk .= $_;
+ }
+ }
+
+ seek(TMPI, 0, 0);
+}
+