These are pretty self-explainable. I think I tried to sumbit these
changes with the serial debugging patch year and some months ago and I
was told to sign the copyright assignment. I have already done that
now. :)

2008-04-15  Lubomir Kundrak  <[EMAIL PROTECTED]>

        * kern/main.c (grub_main) [!GRUB_UTIL]: Alias grub_main to main,
        so that gdb is able to find stack top.
        * genmk.rb: replace strip with objcopy, so unstripped files are
        left untouched for debugging purposes.

-- 
Lubomir Kundrak (Red Hat Security Response Team)
diff -rup grub-1.95.orig/kern/main.c grub-1.95/kern/main.c
--- grub-1.95.orig/kern/main.c	2007-01-29 15:31:36.000000000 +0100
+++ grub-1.95/kern/main.c	2007-01-30 18:29:55.000000000 +0100
@@ -106,6 +106,14 @@ grub_load_normal_mode (void)
   grub_errno = GRUB_ERR_NONE;
 }
 
+#ifndef GRUB_UTIL
+/*
+ * Let GDB find the stack top
+ */
+void
+main (void) __attribute__ ((alias("grub_main")));
+#endif
+
 /* The main routine.  */
 void
 grub_main (void)
--- grub-1.95.cvs20071119.orig/genmk.rb	2007-11-27 10:58:52.000000000 +0100
+++ grub-1.95.cvs20071119/genmk.rb	2007-11-27 11:17:58.000000000 +0100
@@ -101,10 +101,11 @@
     mod_obj = mod_src.suffix('o')
     defsym = 'def-' + @name.suffix('lst')
     undsym = 'und-' + @name.suffix('lst')
+    exec = @name.suffix('exec')
     mod_name = File.basename(@name, '.mod')
     symbolic_name = mod_name.sub(/\.[^\.]*$/, '')
     
-    "CLEANFILES += [EMAIL PROTECTED] #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym}
+    "CLEANFILES += [EMAIL PROTECTED] #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym} #{exec}
 ifneq ($(#{prefix}_EXPORTS),no)
 CLEANFILES += #{defsym}
 DEFSYMFILES += #{defsym}
@@ -112,10 +113,13 @@
 MOSTLYCLEANFILES += #{deps_str}
 UNDSYMFILES += #{undsym}
 
[EMAIL PROTECTED]: #{pre_obj} #{mod_obj}
[EMAIL PROTECTED]: #{exec}
+	-rm -f $@
+	$(OBJCOPY) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment -R .note.gnu.build-id $^ $@
+
+#{exec}: #{pre_obj} #{mod_obj}
 	-rm -f $@
 	$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-	$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment -R .note.gnu.build-id $@
 
 #{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str}
 	-rm -f $@
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to