From bdefff91ce449c737c4eae968f1da6da324b9978 Mon Sep 17 00:00:00 2001 From: Sam Demeulemeester <38105886+x86fr@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:39:00 +0100 Subject: [PATCH] Fix LD error while linking LoongArch EFI binary (#457) --- build64/la64/Makefile | 4 +++- build64/la64/ldscripts/memtest_efi.lds | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build64/la64/Makefile b/build64/la64/Makefile index e1a9235..39a9a0f 100644 --- a/build64/la64/Makefile +++ b/build64/la64/Makefile @@ -183,7 +183,9 @@ memtest.debug: memtest_shared memtest.efi: memtest_shared.bin boot/loongarch/header.o ldscripts/memtest_efi.lds $(eval SIZES=$(shell size -B -d memtest_shared | grep memtest_shared)) - $(LD) --defsym=_bss_size=$(word 3,$(SIZES)) -T ldscripts/memtest_efi.lds boot/loongarch/header.o -b binary memtest_shared.bin -o memtest.efi + $(LD) --defsym=_bss_size=$(word 3,$(SIZES)) -T ldscripts/memtest_efi.lds boot/loongarch/header.o -b binary memtest_shared.bin -o memtest.elf + $(OBJCOPY) -O binary memtest.elf memtest.efi + rm -f memtest.elf esp.img: memtest.efi @mkdir -p iso/EFI/BOOT diff --git a/build64/la64/ldscripts/memtest_efi.lds b/build64/la64/ldscripts/memtest_efi.lds index b2b760c..6482b23 100644 --- a/build64/la64/ldscripts/memtest_efi.lds +++ b/build64/la64/ldscripts/memtest_efi.lds @@ -1,4 +1,4 @@ -OUTPUT_FORMAT("binary") +OUTPUT_FORMAT("elf64-loongarch") OUTPUT_ARCH(loongarch) ENTRY(head);