2 ### Generate GDB commands, that load symbols for specified module,
3 ### with proper section relocations. See .gdbinit
6 ### Lubomir Kundrak <lkudrak@skosi.org>
12 my ($name, %sections) = split;
14 print "add-symbol-file $name.module";
16 open (READELF
, "readelf -S $name.mod |") or die;
18 /\[\s*(\d+)\]\s+(\.\S+)/ or next;
21 print " $sections{$1}";
25 print " -s $2 $sections{$1}"
26 if ($sections{$1} ne '0x0' and $sections{$1} ne '');