瀏覽代碼

x86: Rearrange the output input to remove BSS

At present BSS data is including in the image, which wastes binary space.
Remove it by rearranging the sections so that BSS is last.

Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass 12 年之前
父節點
當前提交
f82d15ead1
共有 1 個文件被更改,包括 12 次插入7 次删除
  1. 12 7
      arch/x86/cpu/u-boot.lds

+ 12 - 7
arch/x86/cpu/u-boot.lds

@@ -45,9 +45,6 @@ SECTIONS
 	. = ALIGN(4);
 	. = ALIGN(4);
 	.data : { *(.data*) }
 	.data : { *(.data*) }
 
 
-	. = ALIGN(4);
-	.dynsym : { *(.dynsym*) }
-
 	. = ALIGN(4);
 	. = ALIGN(4);
 	.hash : { *(.hash*) }
 	.hash : { *(.hash*) }
 
 
@@ -58,10 +55,7 @@ SECTIONS
 	__data_end = .;
 	__data_end = .;
 
 
 	. = ALIGN(4);
 	. = ALIGN(4);
-	__bss_start = ABSOLUTE(.);
-	.bss (NOLOAD) : { *(.bss) }
-	. = ALIGN(4);
-	__bss_end = ABSOLUTE(.);
+	.dynsym : { *(.dynsym*) }
 
 
 	. = ALIGN(4);
 	. = ALIGN(4);
 	__rel_dyn_start = .;
 	__rel_dyn_start = .;
@@ -70,6 +64,17 @@ SECTIONS
 	. = ALIGN(4);
 	. = ALIGN(4);
 	_end = .;
 	_end = .;
 
 
+	. = ALIGN(4);
+
+	__end = .;
+	.bss __rel_dyn_start (OVERLAY) : {
+		__bss_start = .;
+		*(.bss)
+		*(COM*)
+		. = ALIGN(4);
+		__bss_end = .;
+	}
+
 	/DISCARD/ : { *(.dynstr*) }
 	/DISCARD/ : { *(.dynstr*) }
 	/DISCARD/ : { *(.dynamic*) }
 	/DISCARD/ : { *(.dynamic*) }
 	/DISCARD/ : { *(.plt*) }
 	/DISCARD/ : { *(.plt*) }