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

Re: [Minios-devel] [UNIKRAFT PATCH] plat/xen: Arm32, x86_64: Unify linker scripts



Hello Simon,

This patch seems fine.
Reviewed-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>

Thanks & Regards
Sharan

On 2/12/19 3:21 PM, Simon Kuenzer wrote:
Unify linker scripts of both architectures of the Xen platform.
For simplicity, the layout and linker-provided symbols should
be as close as possible.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
  plat/xen/arm/link32.lds | 20 ++++++++++++++------
  plat/xen/x86/link64.lds | 18 +++++++++++++-----
  2 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/plat/xen/arm/link32.lds b/plat/xen/arm/link32.lds
index c5d83008..ce200b67 100644
--- a/plat/xen/arm/link32.lds
+++ b/plat/xen/arm/link32.lds
@@ -72,31 +72,39 @@ SECTIONS
                KEEP (*(.init_array .ctors))
                PROVIDE_HIDDEN (__init_array_end = .);
        }
+       . = ALIGN(4096);
        _ectors = .;
- .data : { /* Data */
-               _data = .;
+       /* Data */
+       _data = .;
+       .data : {
                *(.data)
+               *(.data.*)
        }
+       _edata = .; /* End of data included in image */
- /* Note: linker will insert any extra sections here, just before .bss */
+       /*
+        * NOTE: linker will insert any extra sections here,
+        * just before .bss
+        */
.bss : {
-               _edata = .;             /* End of data included in image */
-               /* Nothing after here is included in the zImage's size */
-
                __bss_start = .;
                *(.bss)
                *(.bss.*)
        }
+       . = ALIGN(4096);
        _end = . ;
+
        /* Sections to be discarded */
+       /* TODO: Revisit when we have a solution for discarded sections
        /DISCARD/ : {
                *(.text.exit)
                *(.data.exit)
                *(.exitcall.exit)
        }
+       */
/* Stabs debugging sections. */
        .stab 0 : { *(.stab) }
diff --git a/plat/xen/x86/link64.lds b/plat/xen/x86/link64.lds
index 5391dbda..dce0baf2 100644
--- a/plat/xen/x86/link64.lds
+++ b/plat/xen/x86/link64.lds
@@ -62,24 +62,32 @@ SECTIONS
                KEEP (*(.init_array .ctors))
                PROVIDE_HIDDEN (__init_array_end = .);
        }
+       . = ALIGN(4096);
        _ectors = .;
+ /* Data */
        _data = .;
-       .data : {                       /* Data */
+       .data : {
                *(.data)
+               *(.data.*)
        }
+       _edata = .; /* End of data included in image */
- _edata = .; /* End of data section */
+       /*
+        * NOTE: linker will insert any extra sections here,
+        * just before .bss
+        */
- __bss_start = .; /* BSS */
        .bss : {
+               __bss_start = .;
                *(.bss)
-               . = ALIGN(4096);
+               *(.bss.*)
        }
+       . = ALIGN(4096);
        _end = . ;
/* Sections to be discarded */
-       /* TODO revisit when we have a resolution for discarded sections
+       /* TODO: Revisit when we have a solution for discarded sections
        /DISCARD/ : {
                *(.text.exit)
                *(.data.exit)


_______________________________________________
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®.