Browse code

getLinkedSection() now follows an arbitrary attribute.

getLinkedSection() was initially hardcoded to fetch the section linked via
sh_link. Now, thanks to one extra, optional parameter, she can follow any
attribute, e.g. sh_info.

Xavier G authored on 17/08/2015 21:38:55
Showing 1 changed files
... ...
@@ -3741,11 +3741,12 @@ sub displayHashDetailsForSymbol {
3741 3741
 sub getLinkedSection {
3742 3742
 	my $elf_data = shift;
3743 3743
 	my $section_index = shift;
3744
+	my $sh_attribute = shift || 'sh_link';
3744 3745
 
3745 3746
 	my $section = $elf_data->{'sections'}->{$section_index};
3746 3747
 	return undef if (!defined($section));
3747 3748
 
3748
-	my $linked_index = $section->{'sh_link'};
3749
+	my $linked_index = $section->{$sh_attribute};
3749 3750
 	if ($linked_index && exists($elf_data->{'sections'}->{$linked_index})) {
3750 3751
 		return $elf_data->{'sections'}->{$linked_index};
3751 3752
 	}