nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0412-util-mkimage-Remove-unused-code-to-add-BSS-section.patch

9723a8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
9723a8
From: Javier Martinez Canillas <javierm@redhat.com>
9723a8
Date: Thu, 11 Feb 2021 17:06:49 +0100
9723a8
Subject: [PATCH] util/mkimage: Remove unused code to add BSS section
9723a8
9723a8
The code is compiled out so there is no reason to keep it.
9723a8
9723a8
Additionally, don't set bss_size field since we do not add a BSS section.
9723a8
9723a8
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
9723a8
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
9723a8
---
9723a8
 util/mkimage.c | 17 -----------------
9723a8
 1 file changed, 17 deletions(-)
9723a8
9723a8
diff --git a/util/mkimage.c b/util/mkimage.c
9723a8
index e22d82afa61..7dbd504ec5b 100644
9723a8
--- a/util/mkimage.c
9723a8
+++ b/util/mkimage.c
9723a8
@@ -1257,7 +1257,6 @@ grub_install_generate_image (const char *dir, const char *prefix,
9723a8
 	    o->code_size = grub_host_to_target32 (layout.exec_size);
9723a8
 	    o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size
9723a8
 					     - header_size);
9723a8
-	    o->bss_size = grub_cpu_to_le32 (layout.bss_size);
9723a8
 	    o->entry_addr = grub_cpu_to_le32 (layout.start_address);
9723a8
 	    o->code_base = grub_cpu_to_le32 (header_size);
9723a8
 
9723a8
@@ -1295,7 +1294,6 @@ grub_install_generate_image (const char *dir, const char *prefix,
9723a8
 	    o->code_size = grub_host_to_target32 (layout.exec_size);
9723a8
 	    o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size
9723a8
 					     - header_size);
9723a8
-	    o->bss_size = grub_cpu_to_le32 (layout.bss_size);
9723a8
 	    o->entry_addr = grub_cpu_to_le32 (layout.start_address);
9723a8
 	    o->code_base = grub_cpu_to_le32 (header_size);
9723a8
 	    o->image_base = 0;
9723a8
@@ -1340,21 +1338,6 @@ grub_install_generate_image (const char *dir, const char *prefix,
9723a8
 	  = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA
9723a8
 			      | GRUB_PE32_SCN_MEM_READ
9723a8
 			      | GRUB_PE32_SCN_MEM_WRITE);
9723a8
-
9723a8
-#if 0
9723a8
-	bss_section = data_section + 1;
9723a8
-	strcpy (bss_section->name, ".bss");
9723a8
-	bss_section->virtual_size = grub_cpu_to_le32 (layout.bss_size);
9723a8
-	bss_section->virtual_address = grub_cpu_to_le32 (header_size + layout.kernel_size);
9723a8
-	bss_section->raw_data_size = 0;
9723a8
-	bss_section->raw_data_offset = 0;
9723a8
-	bss_section->characteristics
9723a8
-	  = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_MEM_READ
9723a8
-			      | GRUB_PE32_SCN_MEM_WRITE
9723a8
-			      | GRUB_PE32_SCN_ALIGN_64BYTES
9723a8
-			      | GRUB_PE32_SCN_CNT_INITIALIZED_DATA
9723a8
-			      | 0x80);
9723a8
-#endif
9723a8
     
9723a8
 	mods_section = data_section + 1;
9723a8
 	strcpy (mods_section->name, "mods");