source: mainline/boot/grub/ia32-pc/i386-pc/gmodule.pl

Last change on this file was a114e09, checked in by Jakub Jermář <jakub@…>, 6 years ago

Allow per-boot-architecture GRUB files

Organize pre-compiled GRUB binaries per-architecture in order to prepare
the layout for adding an AArch64-EFI version of this bootloader:

  • Rename boot/grub.pc to boot/grub/ia32-pc.
  • Rename boot/grub.efi to boot/grub/ia32-efi.
  • Create symlinks boot/grub/amd64-pc and amd64-efi pointing to boot/grub/ia32-pc and ia32-efi, respectively.
  • Property mode set to 100644
File size: 635 bytes
Line 
1###
2### Generate GDB commands, that load symbols for specified module,
3### with proper section relocations. See .gdbinit
4###
5### $Id: gmodule.pl,v 1.2 2006/05/14 11:38:42 lkundrak Exp lkundrak $
6### Lubomir Kundrak <lkudrak@skosi.org>
7###
8
9use strict;
10
11while (<>) {
12 my ($name, %sections) = split;
13
14 print "add-symbol-file $name.module";
15
16 open (READELF, "readelf -S $name.mod |") or die;
17 while (<READELF>) {
18 /\[\s*(\d+)\]\s+(\.\S+)/ or next;
19
20 if ($2 eq '.text') {
21 print " $sections{$1}";
22 next;
23 }
24
25 print " -s $2 $sections{$1}"
26 if ($sections{$1} ne '0x0' and $sections{$1} ne '');
27 };
28 close (READELF);
29 print "\n";
30}
Note: See TracBrowser for help on using the repository browser.