]> xenbits.xensource.com Git - people/aperard/xtf.git/commitdiff
build: Make head.S invariant to link order
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 5 Feb 2022 17:28:16 +0000 (17:28 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 Feb 2022 11:25:56 +0000 (11:25 +0000)
Introduce .text.head, ensure it is linked first, and use it in
{hvm,pv}/head.S.  This removes the need for head-$(env).o to be linked first,
removing all head special casing in the build system.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/hvm/head.S
arch/x86/link.lds.S
arch/x86/pv/head.S
build/common.mk
build/files.mk

index a5c11501b2bcdce81d81a06bd19383db68dbee03..cfe165e2832f7db9fec2594cc27c19d4843ee5d2 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <xen/elfnote.h>
 
+        .section ".text.head", "ax", @progbits
         .code32                 /* Always starts in 32bit flat mode. */
 GLOBAL(_elf_start)              /* HVM common setup. */
 
index 4daee1c4e5a127f0c79c56e518f2afab1497276d..a7716d6d97f019dc0447fa91b84897c50abf9a42 100644 (file)
@@ -37,6 +37,7 @@ SECTIONS
         _start = .;
 
         .text : {
+                *(.text.head)
                 *(.text)
 
        . = ALIGN(PAGE_SIZE);
index 5ff8b8a747f415fbc9e49f92e7757535a47b4eba..0b2592f9691c139e74142addf2353e1ef0b146a5 100644 (file)
@@ -17,7 +17,7 @@ ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
 ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb")
 ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
 
-        .text
+        .section ".text.head", "ax", @progbits
         __ASM_SEL(.code32, .code64)
 
  /* PV entry point. */
index 594952df9406023231b9a93c58a734fa8d03b453..f81b2dab12f1175d0335cf06bbc9472fe29b6df1 100644 (file)
@@ -53,13 +53,12 @@ CFLAGS_$($(1)_arch) := $$(COMMON_CFLAGS) $$(COMMON_CFLAGS-$($(1)_arch))
 AFLAGS_$(1) := $$(AFLAGS_$($(1)_arch)) $$(COMMON_AFLAGS-$(1)) -DCONFIG_ENV_$(1) -include arch/config.h
 CFLAGS_$(1) := $$(CFLAGS_$($(1)_arch)) $$(COMMON_CFLAGS-$(1)) -DCONFIG_ENV_$(1) -include arch/config.h
 
-head-$(1) := $(ROOT)/arch/x86/$($(1)_guest)/head-$(1).o
 link-$(1) := $(ROOT)/arch/x86/link-$(1).lds
 
 LDFLAGS_$(1) := -T $$(link-$(1)) -nostdlib $(LDFLAGS-y)
 
 # Needs to pick up test-provided obj-perenv and obj-perarch
-DEPS-$(1) = $$(head-$(1)) \
+DEPS-$(1) = \
        $$(obj-perarch:%.o=%-$($(1)_arch).o) \
        $$(obj-$(1):%.o=%-$(1).o) $$(obj-perenv:%.o=%-$(1).o)
 
index 5c1cc8d80edbdf4aea9851be39c732cb46c7d4d7..af31c65961f8f20e11338dd49c5e7885b062d09a 100644 (file)
@@ -31,6 +31,7 @@ obj-perenv += $(ROOT)/arch/x86/traps.o
 # HVM specific objects
 obj-hvm += $(ROOT)/arch/x86/apic.o
 obj-hvm += $(ROOT)/arch/x86/hpet.o
+obj-hvm += $(ROOT)/arch/x86/hvm/head.o
 obj-hvm += $(ROOT)/arch/x86/hvm/pagetables.o
 obj-hvm += $(ROOT)/arch/x86/hvm/traps.o
 obj-hvm += $(ROOT)/arch/x86/io-apic.o
@@ -43,6 +44,7 @@ $(foreach env,$(HVM_ENVIRONMENTS),$(eval obj-$(env) += $(obj-hvm)))
 
 
 # PV specific objects
+obj-pv  += $(ROOT)/arch/x86/pv/head.o
 obj-pv  += $(ROOT)/arch/x86/pv/traps.o
 $(foreach env,$(PV_ENVIRONMENTS),$(eval obj-$(env) += $(obj-pv)))