dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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