Skip to contentSkip to conversation

multiboot ELF section header table info passing missing in grub2?

DISCUSSION Jonathan A. Kollasch 2 participants 2 messages Aug 12, 2008 – Sep 8, 2008

lore
Share & tools
lore
#0 lore raw

hi,

Robert noted that I should mention this:

The ELF section header table MBI seems to not be implemented in grub2. NetBSD/i386 uses this to find symbol names in it's kernel debugger.

Jonathan Kollasch

#1 lore raw
Quoted 6 lines · Jonathan A. Kollasch

hi,

Robert noted that I should mention this:

The ELF section header table MBI seems to not be implemented in grub2. NetBSD/i386 uses this to find symbol names in it's kernel debugger.

For the record (Jonathan already knows), I made this patch, which is supposed to implement it using code from GRUB Legacy.

It needs some cleanup, but since I have no readily available testcase (NetBSD's kernel seems to have some trouble involving MBI corruption), I can't finish it yet.

I'm sending it here for reference.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
include/grub/multiboot.h +22 -3
diff -ur grub2.old/include/grub/multiboot.h grub2/include/grub/multiboot.h
@@ -1,7 +1,7 @@
 /* multiboot.h - multiboot header file with grub definitions. */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003,2007,2008  Free Software Foundation, Inc.
+ *  Copyright (C) 2000,2003,2007,2008  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -73,8 +73,27 @@
   grub_uint32_t mods_count;
   grub_uint32_t mods_addr;
   
-  grub_uint32_t syms[4];
-  
+  union
+  {
+    struct
+    {
+      /* a.out payload symbol table info */
+      grub_uint32_t tabsize;
+      grub_uint32_t strsize;
+      grub_uint32_t addr;
+      grub_uint32_t pad;
+    } aout;
+
+    struct
+    {
+      /* ELF payload section header table */
+      grub_uint32_t num;
+      grub_uint32_t size;
+      grub_uint32_t addr;
+      grub_uint32_t shndx;
+    } elf;
+  } syms;
+
   /* Memory Mapping buffer */
   grub_uint32_t mmap_length;
   grub_uint32_t mmap_addr;
loader/i386/pc/multiboot.c +55 -1

68 lines not on this page · raw message