8 return substr($num, 6, 2).substr($num, 4, 2).substr ($num, 2, 2).substr ($num, 0, 2);
11 open (DATA
, $OBJDUMP.' --full-contents --section=.data getconsdata.o | grep \'^ 00\' |') ||
12 die ('Cant objdump!');
14 ($addr, $data0, $data1, $data2, $data3) = split (' ');
15 $dat[hex($addr)] = hex(&swapdata
($data0));
16 $dat[hex($addr)+4] = hex(&swapdata
($data1));
17 $dat[hex($addr)+8] = hex(&swapdata
($data2));
18 $dat[hex($addr)+12] = hex(&swapdata
($data3));
22 open (DATA
, $OBJDUMP.' --syms getconsdata.o |') || die ('Cant objdump!');
24 /elf32/ && ( $elf = 1 );
25 /a.out/ && ( $aout = 1 );
26 next if ($aout && ! / 07 /);
27 next if ($elf && ! (/^0*0...... g/ && /.data/));
28 next if (!$aout && !$elf);
31 ($addr, $flags, $sect, $a1, $a2, $a3, $name) = split (' ');
32 $nam[hex($addr)] = substr($name, 1);
36 $addr = substr ($_, 0, index($_, " "));
37 $name = substr ($_, rindex($_, " ") + 1);
38 $nam[hex($addr)] = $name;
43 print "/*\n * *** This file is automatically generated from getconsdata.c. Do not edit! ***\n */\n";
44 for ($i = 0; $i < hex($addr)+4; $i += 4) {
45 print "#define $nam[$i] $dat[$i]\n";