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

[Minios-devel] [MINIOS PATCH 2/3] x86: switch to use elfnote



Use the newer ELF note interface. The generated ELF notes results in
equivalent configuration.

Also need to modify linker script to provide a note section.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
 arch/x86/minios-x86_32.lds |  4 ++++
 arch/x86/minios-x86_64.lds |  4 ++++
 arch/x86/x86_32.S          | 17 +++++++----------
 arch/x86/x86_64.S          | 15 ++++++---------
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/arch/x86/minios-x86_32.lds b/arch/x86/minios-x86_32.lds
index f5cabb6..e4e18cb 100644
--- a/arch/x86/minios-x86_32.lds
+++ b/arch/x86/minios-x86_32.lds
@@ -15,6 +15,10 @@ SECTIONS
   .rodata : { *(.rodata) *(.rodata.*) }
   . = ALIGN(4096);
   _erodata = .;
+  .note : {
+       *(.note)
+       *(.note.*)
+  }
 
   /* newlib initialization functions */
   . = ALIGN(32 / 8);
diff --git a/arch/x86/minios-x86_64.lds b/arch/x86/minios-x86_64.lds
index 3da0a9f..f6462f3 100644
--- a/arch/x86/minios-x86_64.lds
+++ b/arch/x86/minios-x86_64.lds
@@ -15,6 +15,10 @@ SECTIONS
   .rodata : { *(.rodata) *(.rodata.*) }
   . = ALIGN(4096);
   _erodata = .;
+  .note : {
+       *(.note)
+       *(.note.*)
+  }
 
   /* newlib initialization functions */
   . = ALIGN(64 / 8);
diff --git a/arch/x86/x86_32.S b/arch/x86/x86_32.S
index b9aa392..6dc985a 100644
--- a/arch/x86/x86_32.S
+++ b/arch/x86/x86_32.S
@@ -1,17 +1,14 @@
 #include <mini-os/os.h>
 #include <mini-os/x86/arch_limits.h>
+#include <mini-os/asm_macros.h>
+#include <xen/elfnote.h>
 #include <xen/arch-x86_32.h>
 
-.section __xen_guest
-       .ascii  "GUEST_OS=Mini-OS"
-       .ascii  ",XEN_VER=xen-3.0"
-       .ascii  ",VIRT_BASE=0x0" /* &_text from minios_x86_32.lds */
-       .ascii  ",ELF_PADDR_OFFSET=0x0"
-       .ascii  ",HYPERCALL_PAGE=0x2"
-       .ascii  ",PAE=yes[extended-cr3]"
-       .ascii  ",LOADER=generic"
-       .byte   0
-.text
+ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "Mini-OS")
+ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
+ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _WORD hypercall_page)
+ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
+ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
 
 .globl _start, shared_info, hypercall_page
                         
diff --git a/arch/x86/x86_64.S b/arch/x86/x86_64.S
index 72921b1..8ed452f 100644
--- a/arch/x86/x86_64.S
+++ b/arch/x86/x86_64.S
@@ -1,16 +1,13 @@
 #include <mini-os/os.h>
 #include <mini-os/x86/arch_limits.h>
+#include <mini-os/asm_macros.h>
+#include <xen/elfnote.h>
 #include <xen/features.h>
 
-.section __xen_guest
-       .ascii  "GUEST_OS=Mini-OS"
-       .ascii  ",XEN_VER=xen-3.0"
-       .ascii  ",VIRT_BASE=0x0" /* &_text from minios_x86_64.lds */
-       .ascii  ",ELF_PADDR_OFFSET=0x0"
-       .ascii  ",HYPERCALL_PAGE=0x2"
-       .ascii  ",LOADER=generic"
-       .byte   0
-.text
+ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "Mini-OS")
+ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
+ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _WORD hypercall_page)
+ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
 
 #define ENTRY(X) .globl X ; X :
 .globl _start, shared_info, hypercall_page
-- 
2.1.4


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

 


Rackspace

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