Indentation fix, cleanup.
[AROS.git] / arch / all-pc / boot / grub2-aros / grub-core / gmodule.pl.in
blob3d7242f2ff9e2460f0a9498be68734c9b37538fb
1 ###
2 ### Generate GDB commands, that load symbols for specified module,
3 ### with proper section relocations. See .gdbinit
4 ###
5 ### $Id$
6 ### Lubomir Kundrak <lkudrak@skosi.org>
7 ###
9 use strict;
11 while (<>) {
12 my ($name, %sections) = split;
14 print "add-symbol-file $name.module";
16 open (READELF, "readelf -S $name.mod |") or die;
17 while (<READELF>) {
18 /\[\s*(\d+)\]\s+(\.\S+)/ or next;
20 if ($2 eq '.text') {
21 print " $sections{$1}";
22 next;
25 print " -s $2 $sections{$1}"
26 if ($sections{$1} ne '0x0' and $sections{$1} ne '');
28 close (READELF);
29 print "\n";