[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCHv5 16/46] plat/kvm: Generate linker scripts from source code


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Fri, 10 Aug 2018 07:08:06 +0000
  • Authentication-results: spf=fail (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=arm.com;
  • Cc: Kaly.Xin@xxxxxxx, nd@xxxxxxx, wei.chen@xxxxxxx
  • Delivery-date: Fri, 10 Aug 2018 07:09:52 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Sometimes, using a macro in linker script will be easier for people
to see what is done. This means we will share macros with source code.
So, generate linker script from a .S will help linker script to share
macros with source code.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 plat/kvm/Linker.uk                       | 7 +++++--
 plat/kvm/x86/{link64.ld => link64.lds.S} | 0
 2 files changed, 5 insertions(+), 2 deletions(-)
 rename plat/kvm/x86/{link64.ld => link64.lds.S} (100%)

diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk
index 2292b03..fbadde2 100644
--- a/plat/kvm/Linker.uk
+++ b/plat/kvm/Linker.uk
@@ -1,5 +1,6 @@
 ifeq (x86_64,$(CONFIG_UK_ARCH))
-KVM_LDSCRIPT  := -Wl,-T,$(CONFIG_UK_BASE)/plat/kvm/x86/link64.ld
+KVM_LDSCRIPT  := -Wl,-T,$(CONFIG_UK_BASE)/plat/kvm/x86/link64.lds
+KVM_LDSCRIPT_FLAGS := -Wl,-T,$(KVM_LDSCRIPT)
 KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
 endif
 
@@ -14,8 +15,10 @@ $(KVM_IMAGE): $(KVM_LINK) $(KVM_LINK-y) $(UK_LINK) 
$(UK_LINK-y)
        $(call build_cmd,OBJCOPY,,$@.o,\
               $(OBJCOPY) -w -G kvmos_* -G _libkvmplat_entry $@.ld.o $@.o)
 ifeq (x86_64,$(CONFIG_UK_ARCH))
+       $(call build_cmd,CC,,link64.lds.o,\
+              $(CC) -E $(ASINCLUDES) $(ASFLAGS) $(ASFLAGS-y) -P 
$(KVM_LDSCRIPT).S -o $(KVM_LDSCRIPT))
        $(call build_cmd,LD,,$@,\
-              $(LD) $(LDFLAGS) $(LDFLAGS-y) $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) 
$(KVM_LDSCRIPT) $@.o -o $@)
+              $(LD) $(LDFLAGS) $(LDFLAGS-y) $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) 
$(KVM_LDSCRIPT_FLAGS) $@.o -o $@)
 ifeq ($(CONFIG_OPTIMIZE_DBGFILE),y)
        $(call build_cmd,OBJCOPY,,$@.dbg,\
               $(OBJCOPY) --only-keep-debug $@ $@.dbg)
diff --git a/plat/kvm/x86/link64.ld b/plat/kvm/x86/link64.lds.S
similarity index 100%
rename from plat/kvm/x86/link64.ld
rename to plat/kvm/x86/link64.lds.S
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.