Skip to contentSkip to conversation

efi_loader: helloworld.c: Reduce file size

PATCH New Alexander Graf 1 participant 1 message Dec 11, 2017 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: helloworld.c: Reduce file size

The efi linker script includes sections needed for the dynamic linker. However, in our EFI application environment we don't have a dynamic linker.

So let's remove them. That way we save on 4k padding and reduce the file size of the hello world efi binary from ~4k to ~1k.

---
 arch/arm/lib/elf_arm_efi.lds | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
arch/arm/lib/elf_arm_efi.lds +4 -7
index 59f66a1d4a..15c9c5c672 100644
@@ -55,16 +55,13 @@ SECTIONS
 	.rel.data : { *(.rel.data) *(.rel.data*) }
 	_data_size = . - _etext;
 
-	. = ALIGN(4096);
-	.dynsym   : { *(.dynsym) }
-	. = ALIGN(4096);
-	.dynstr   : { *(.dynstr) }
-	. = ALIGN(4096);
-	.note.gnu.build-id : { *(.note.gnu.build-id) }
 	/DISCARD/ : {
 		*(.rel.reloc)
 		*(.eh_frame)
 		*(.note.GNU-stack)
+		*(.dynsym)
+		*(.dynstr)
+		*(.note.gnu.build-id)
+		*(.comment)
 	}
-	.comment 0 : { *(.comment) }
 }
Signature · 1 line
2.12.3