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

Re: [Minios-devel] [UNIKRAFT PATCH 2/8] plat/kvm, plat/xen: Rename linker script file name extension to '.lds'



Reviewed-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>

Simon Kuenzer <simon.kuenzer@xxxxxxxxx> writes:

> The linker script file extension '.lds' (alias "ld script") seems to be
> more natural understandable than '.ld' for linker script files.
> We also plan to introduce the extension '.ldS' for linker scripts that
> have to be processed by GCC's preprocessor. But first of all, we adopt
> the existing files to this new file name extension convention.
>
> Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
> ---
>  plat/kvm/Linker.uk      |   2 +-
>  plat/kvm/x86/link64.ld  |  94 -----------------------------------------
>  plat/kvm/x86/link64.lds |  94 +++++++++++++++++++++++++++++++++++++++++
>  plat/xen/Linker.uk      |   8 ++--
>  plat/xen/arm/link32.ld  | 109 
> ------------------------------------------------
>  plat/xen/arm/link32.lds | 109 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  plat/xen/x86/link64.ld  |  89 ---------------------------------------
>  plat/xen/x86/link64.lds |  89 +++++++++++++++++++++++++++++++++++++++
>  8 files changed, 297 insertions(+), 297 deletions(-)
>  delete mode 100644 plat/kvm/x86/link64.ld
>  create mode 100644 plat/kvm/x86/link64.lds
>  delete mode 100644 plat/xen/arm/link32.ld
>  create mode 100644 plat/xen/arm/link32.lds
>  delete mode 100644 plat/xen/x86/link64.ld
>  create mode 100644 plat/xen/x86/link64.lds
>
> diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk
> index b43072f..721ab4f 100644
> --- a/plat/kvm/Linker.uk
> +++ b/plat/kvm/Linker.uk
> @@ -1,5 +1,5 @@
>  ifeq (x86_64,$(CONFIG_UK_ARCH))
> -KVM_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/kvm/x86/link64.ld
> +KVM_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/kvm/x86/link64.lds
>  KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
>  endif
>  
> diff --git a/plat/kvm/x86/link64.ld b/plat/kvm/x86/link64.ld
> deleted file mode 100644
> index 60b5d21..0000000
> --- a/plat/kvm/x86/link64.ld
> +++ /dev/null
> @@ -1,94 +0,0 @@
> -/* SPDX-License-Identifier: ISC */
> -/*
> - * Author(s): Dan Williams <djwillia@xxxxxxxxxx>
> - *            Martin Lucina <martin.lucina@xxxxxxxxxx>
> - *            Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
> - *
> - * Copyright (c) 2016, IBM
> - *           (c) 2016-2017 Docker, Inc.
> - *           (c) 2017-2018, NEC Europe Ltd.
> - *
> - * Permission to use, copy, modify, and/or distribute this software
> - * for any purpose with or without fee is hereby granted, provided
> - * that the above copyright notice and this permission notice appear
> - * in all copies.
> - *
> - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
> - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
> - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
> - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
> - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
> - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
> - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
> - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> - */
> -
> -ENTRY(_libkvmplat_entry)
> -SECTIONS
> -{
> -     . = 0x100000;
> -
> -     /* Code */
> -     _text = .;
> -     .text :
> -     {
> -             /* prevent linker gc from removing multiboot header */
> -             KEEP (*(.data.boot))
> -             *(.text.boot)
> -
> -             *(.text)
> -             *(.text.*)
> -     }
> -     _etext = .;
> -
> -     /* Read-only data */
> -     . = ALIGN(0x1000);
> -     _rodata = .;
> -     .rodata :
> -     {
> -             *(.rodata)
> -             *(.rodata.*)
> -     }
> -     _erodata = .;
> -
> -     /* Constructor tables (read-only) */
> -     _ctors = .;
> -     .preinit_array : {
> -             . = ALIGN(0x8);
> -             PROVIDE_HIDDEN (__preinit_array_start = .);
> -             KEEP (*(.preinit_array))
> -             PROVIDE_HIDDEN (__preinit_array_end = .);
> -     }
> -
> -     .init_array : {
> -             . = ALIGN(0x8);
> -             PROVIDE_HIDDEN (__init_array_start = .);
> -             KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) 
> SORT_BY_INIT_PRIORITY(.ctors.*)))
> -             KEEP (*(.init_array .ctors))
> -             PROVIDE_HIDDEN (__init_array_end = .);
> -     }
> -     _ectors = .;
> -
> -     /* Read-write data (initialized) */
> -     . = ALIGN(0x1000);
> -     _data = .;
> -     .data :
> -     {
> -             *(.data)
> -             *(.data.*)
> -     }
> -     _edata = .;
> -
> -     /* Read-write data (uninitialized) */
> -     . = ALIGN(0x1000);
> -     __bss_start = .;
> -     .bss :
> -     {
> -             *(.bss)
> -             *(.bss.*)
> -             *(COMMON)
> -             . = ALIGN(0x1000);
> -     }
> -
> -     _end = .;
> -}
> diff --git a/plat/kvm/x86/link64.lds b/plat/kvm/x86/link64.lds
> new file mode 100644
> index 0000000..60b5d21
> --- /dev/null
> +++ b/plat/kvm/x86/link64.lds
> @@ -0,0 +1,94 @@
> +/* SPDX-License-Identifier: ISC */
> +/*
> + * Author(s): Dan Williams <djwillia@xxxxxxxxxx>
> + *            Martin Lucina <martin.lucina@xxxxxxxxxx>
> + *            Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
> + *
> + * Copyright (c) 2016, IBM
> + *           (c) 2016-2017 Docker, Inc.
> + *           (c) 2017-2018, NEC Europe Ltd.
> + *
> + * Permission to use, copy, modify, and/or distribute this software
> + * for any purpose with or without fee is hereby granted, provided
> + * that the above copyright notice and this permission notice appear
> + * in all copies.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
> + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
> + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
> + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
> + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
> + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
> + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
> + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + */
> +
> +ENTRY(_libkvmplat_entry)
> +SECTIONS
> +{
> +     . = 0x100000;
> +
> +     /* Code */
> +     _text = .;
> +     .text :
> +     {
> +             /* prevent linker gc from removing multiboot header */
> +             KEEP (*(.data.boot))
> +             *(.text.boot)
> +
> +             *(.text)
> +             *(.text.*)
> +     }
> +     _etext = .;
> +
> +     /* Read-only data */
> +     . = ALIGN(0x1000);
> +     _rodata = .;
> +     .rodata :
> +     {
> +             *(.rodata)
> +             *(.rodata.*)
> +     }
> +     _erodata = .;
> +
> +     /* Constructor tables (read-only) */
> +     _ctors = .;
> +     .preinit_array : {
> +             . = ALIGN(0x8);
> +             PROVIDE_HIDDEN (__preinit_array_start = .);
> +             KEEP (*(.preinit_array))
> +             PROVIDE_HIDDEN (__preinit_array_end = .);
> +     }
> +
> +     .init_array : {
> +             . = ALIGN(0x8);
> +             PROVIDE_HIDDEN (__init_array_start = .);
> +             KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) 
> SORT_BY_INIT_PRIORITY(.ctors.*)))
> +             KEEP (*(.init_array .ctors))
> +             PROVIDE_HIDDEN (__init_array_end = .);
> +     }
> +     _ectors = .;
> +
> +     /* Read-write data (initialized) */
> +     . = ALIGN(0x1000);
> +     _data = .;
> +     .data :
> +     {
> +             *(.data)
> +             *(.data.*)
> +     }
> +     _edata = .;
> +
> +     /* Read-write data (uninitialized) */
> +     . = ALIGN(0x1000);
> +     __bss_start = .;
> +     .bss :
> +     {
> +             *(.bss)
> +             *(.bss.*)
> +             *(COMMON)
> +             . = ALIGN(0x1000);
> +     }
> +
> +     _end = .;
> +}
> diff --git a/plat/xen/Linker.uk b/plat/xen/Linker.uk
> index 0c0c4ee..455f10f 100644
> --- a/plat/xen/Linker.uk
> +++ b/plat/xen/Linker.uk
> @@ -1,16 +1,16 @@
>  ifeq (x86_64,$(CONFIG_UK_ARCH))
> -XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/x86/link64.ld
> +XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/x86/link64.lds
>  XEN_LDFLAGS-y += -Wl,-m,elf_x86_64
>  endif
>  ifeq (x86_32,$(CONFIG_UK_ARCH))
> -XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/x86/link32.ld
> +XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/x86/link32.lds
>  XEN_LDFLAGS-y += -Wl,-m,elf_x86_32
>  endif
>  ifeq (arm_64,$(CONFIG_UK_ARCH))
> -XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/arm/link64.ld
> +XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/arm/link64.lds
>  endif
>  ifeq (arm,$(CONFIG_UK_ARCH))
> -XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/arm/link32.ld
> +XEN_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/xen/arm/link32.lds
>  endif
>  
>  ##
> diff --git a/plat/xen/arm/link32.ld b/plat/xen/arm/link32.ld
> deleted file mode 100644
> index 4508e05..0000000
> --- a/plat/xen/arm/link32.ld
> +++ /dev/null
> @@ -1,109 +0,0 @@
> -/* SPDX-License-Identifier: BSD-2-Clause */
> -/*
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - * 1. Redistributions of source code must retain the above copyright
> - *    notice, this list of conditions and the following disclaimer.
> - * 2. Redistributions in binary form must reproduce the above copyright
> - *    notice, this list of conditions and the following disclaimer in the
> - *    documentation and/or other materials provided with the distribution.
> - *
> - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> - * SUCH DAMAGE.
> - *
> - */
> -/* Taken from Mini-OS */
> -
> -OUTPUT_ARCH(arm)
> -ENTRY(_libxenplat_start)
> -SECTIONS
> -{
> -     /* Note: we currently assume that Xen will load the kernel image
> -      * at start-of-RAM + 0x8000. We use this initial 32 KB for the stack
> -      * and translation tables.
> -     */
> -     _boot_stack     = 0x400000;     /* 16 KB boot stack */
> -     _boot_stack_end = 0x404000;
> -     _page_dir       = 0x404000;     /* 16 KB translation table */
> -     .               = 0x408000;
> -     _text = .;                      /* Text and read-only data */
> -     .text : {
> -             *(.text.zimageboot)     /* zImage boot header & code
> -                                        must come first */
> -
> -             *(.text)
> -             *(.gnu.warning)
> -     } = 0x9090
> -
> -     _etext = .;                     /* End of text section */
> -
> -     /* Read-only data */
> -     _rodata = .;
> -     .rodata :
> -     {
> -             *(.rodata)
> -             *(.rodata.*)
> -     }
> -     . = ALIGN(4096);
> -     _erodata = .;
> -
> -     _ctors = .;
> -     .preinit_array : {
> -             . = ALIGN(0x8);
> -             PROVIDE_HIDDEN (__preinit_array_start = .);
> -             KEEP (*(.preinit_array))
> -             PROVIDE_HIDDEN (__preinit_array_end = .);
> -     }
> -
> -     .init_array : {
> -             . = ALIGN(0x8);
> -             PROVIDE_HIDDEN (__init_array_start = .);
> -             KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) 
> SORT_BY_INIT_PRIORITY(.ctors.*)))
> -             KEEP (*(.init_array .ctors))
> -             PROVIDE_HIDDEN (__init_array_end = .);
> -     }
> -     _ectors = .;
> -
> -     .data : {                       /* Data */
> -             _data = .;
> -             *(.data)
> -     }
> -
> -     /* 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)
> -             *(.app.bss)
> -     }
> -     _end = . ;
> -
> -     /* Sections to be discarded */
> -     /DISCARD/ : {
> -             *(.text.exit)
> -             *(.data.exit)
> -             *(.exitcall.exit)
> -     }
> -
> -     /* Stabs debugging sections.  */
> -     .stab 0 : { *(.stab) }
> -     .stabstr 0 : { *(.stabstr) }
> -     .stab.excl 0 : { *(.stab.excl) }
> -     .stab.exclstr 0 : { *(.stab.exclstr) }
> -     .stab.index 0 : { *(.stab.index) }
> -     .stab.indexstr 0 : { *(.stab.indexstr) }
> -     .comment 0 : { *(.comment) }
> -}
> diff --git a/plat/xen/arm/link32.lds b/plat/xen/arm/link32.lds
> new file mode 100644
> index 0000000..4508e05
> --- /dev/null
> +++ b/plat/xen/arm/link32.lds
> @@ -0,0 +1,109 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +/*
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *    notice, this list of conditions and the following disclaimer in the
> + *    documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + *
> + */
> +/* Taken from Mini-OS */
> +
> +OUTPUT_ARCH(arm)
> +ENTRY(_libxenplat_start)
> +SECTIONS
> +{
> +     /* Note: we currently assume that Xen will load the kernel image
> +      * at start-of-RAM + 0x8000. We use this initial 32 KB for the stack
> +      * and translation tables.
> +     */
> +     _boot_stack     = 0x400000;     /* 16 KB boot stack */
> +     _boot_stack_end = 0x404000;
> +     _page_dir       = 0x404000;     /* 16 KB translation table */
> +     .               = 0x408000;
> +     _text = .;                      /* Text and read-only data */
> +     .text : {
> +             *(.text.zimageboot)     /* zImage boot header & code
> +                                        must come first */
> +
> +             *(.text)
> +             *(.gnu.warning)
> +     } = 0x9090
> +
> +     _etext = .;                     /* End of text section */
> +
> +     /* Read-only data */
> +     _rodata = .;
> +     .rodata :
> +     {
> +             *(.rodata)
> +             *(.rodata.*)
> +     }
> +     . = ALIGN(4096);
> +     _erodata = .;
> +
> +     _ctors = .;
> +     .preinit_array : {
> +             . = ALIGN(0x8);
> +             PROVIDE_HIDDEN (__preinit_array_start = .);
> +             KEEP (*(.preinit_array))
> +             PROVIDE_HIDDEN (__preinit_array_end = .);
> +     }
> +
> +     .init_array : {
> +             . = ALIGN(0x8);
> +             PROVIDE_HIDDEN (__init_array_start = .);
> +             KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) 
> SORT_BY_INIT_PRIORITY(.ctors.*)))
> +             KEEP (*(.init_array .ctors))
> +             PROVIDE_HIDDEN (__init_array_end = .);
> +     }
> +     _ectors = .;
> +
> +     .data : {                       /* Data */
> +             _data = .;
> +             *(.data)
> +     }
> +
> +     /* 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)
> +             *(.app.bss)
> +     }
> +     _end = . ;
> +
> +     /* Sections to be discarded */
> +     /DISCARD/ : {
> +             *(.text.exit)
> +             *(.data.exit)
> +             *(.exitcall.exit)
> +     }
> +
> +     /* Stabs debugging sections.  */
> +     .stab 0 : { *(.stab) }
> +     .stabstr 0 : { *(.stabstr) }
> +     .stab.excl 0 : { *(.stab.excl) }
> +     .stab.exclstr 0 : { *(.stab.exclstr) }
> +     .stab.index 0 : { *(.stab.index) }
> +     .stab.indexstr 0 : { *(.stab.indexstr) }
> +     .comment 0 : { *(.comment) }
> +}
> diff --git a/plat/xen/x86/link64.ld b/plat/xen/x86/link64.ld
> deleted file mode 100644
> index 5391dbd..0000000
> --- a/plat/xen/x86/link64.ld
> +++ /dev/null
> @@ -1,89 +0,0 @@
> -/* SPDX-License-Identifier: BSD-2-Clause */
> -/*
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - * 1. Redistributions of source code must retain the above copyright
> - *    notice, this list of conditions and the following disclaimer.
> - * 2. Redistributions in binary form must reproduce the above copyright
> - *    notice, this list of conditions and the following disclaimer in the
> - *    documentation and/or other materials provided with the distribution.
> - *
> - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> - * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
> - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> - * SUCH DAMAGE.
> - */
> -/* Taken from Mini-OS */
> -
> -OUTPUT_FORMAT("elf64-x86-64")
> -OUTPUT_ARCH(i386:x86-64)
> -
> -ENTRY(_libxenplat_start)
> -SECTIONS
> -{
> -     . = 0x0;
> -     _text = .;                      /* Text and read-only data */
> -     .text : {
> -             *(.text.boot)
> -             *(.text)
> -             *(.gnu.warning)
> -     } = 0x2000
> -
> -     _etext = .;                     /* End of text section */
> -
> -     _rodata = .;
> -     .rodata : {
> -             *(.rodata)
> -             *(.rodata.*)
> -     }
> -     . = ALIGN(4096);
> -     _erodata = .;
> -
> -     _ctors = .;
> -     .preinit_array : {
> -             . = ALIGN(0x8);
> -             PROVIDE_HIDDEN (__preinit_array_start = .);
> -             KEEP (*(.preinit_array))
> -             PROVIDE_HIDDEN (__preinit_array_end = .);
> -     }
> -
> -     .init_array : {
> -             . = ALIGN(0x8);
> -             PROVIDE_HIDDEN (__init_array_start = .);
> -             KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) 
> SORT_BY_INIT_PRIORITY(.ctors.*)))
> -             KEEP (*(.init_array .ctors))
> -             PROVIDE_HIDDEN (__init_array_end = .);
> -     }
> -     _ectors = .;
> -
> -     _data = .;
> -     .data : {                       /* Data */
> -             *(.data)
> -     }
> -
> -     _edata = .;                     /* End of data section */
> -
> -     __bss_start = .;                /* BSS */
> -     .bss : {
> -             *(.bss)
> -             . = ALIGN(4096);
> -     }
> -     _end = . ;
> -
> -     /* Sections to be discarded */
> -     /* TODO revisit when we have a resolution for discarded sections
> -     /DISCARD/ : {
> -             *(.text.exit)
> -             *(.data.exit)
> -             *(.exitcall.exit)
> -     }
> -     */
> -}
> diff --git a/plat/xen/x86/link64.lds b/plat/xen/x86/link64.lds
> new file mode 100644
> index 0000000..5391dbd
> --- /dev/null
> +++ b/plat/xen/x86/link64.lds
> @@ -0,0 +1,89 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +/*
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *    notice, this list of conditions and the following disclaimer in the
> + *    documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */
> +/* Taken from Mini-OS */
> +
> +OUTPUT_FORMAT("elf64-x86-64")
> +OUTPUT_ARCH(i386:x86-64)
> +
> +ENTRY(_libxenplat_start)
> +SECTIONS
> +{
> +     . = 0x0;
> +     _text = .;                      /* Text and read-only data */
> +     .text : {
> +             *(.text.boot)
> +             *(.text)
> +             *(.gnu.warning)
> +     } = 0x2000
> +
> +     _etext = .;                     /* End of text section */
> +
> +     _rodata = .;
> +     .rodata : {
> +             *(.rodata)
> +             *(.rodata.*)
> +     }
> +     . = ALIGN(4096);
> +     _erodata = .;
> +
> +     _ctors = .;
> +     .preinit_array : {
> +             . = ALIGN(0x8);
> +             PROVIDE_HIDDEN (__preinit_array_start = .);
> +             KEEP (*(.preinit_array))
> +             PROVIDE_HIDDEN (__preinit_array_end = .);
> +     }
> +
> +     .init_array : {
> +             . = ALIGN(0x8);
> +             PROVIDE_HIDDEN (__init_array_start = .);
> +             KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) 
> SORT_BY_INIT_PRIORITY(.ctors.*)))
> +             KEEP (*(.init_array .ctors))
> +             PROVIDE_HIDDEN (__init_array_end = .);
> +     }
> +     _ectors = .;
> +
> +     _data = .;
> +     .data : {                       /* Data */
> +             *(.data)
> +     }
> +
> +     _edata = .;                     /* End of data section */
> +
> +     __bss_start = .;                /* BSS */
> +     .bss : {
> +             *(.bss)
> +             . = ALIGN(4096);
> +     }
> +     _end = . ;
> +
> +     /* Sections to be discarded */
> +     /* TODO revisit when we have a resolution for discarded sections
> +     /DISCARD/ : {
> +             *(.text.exit)
> +             *(.data.exit)
> +             *(.exitcall.exit)
> +     }
> +     */
> +}
> -- 
> 2.7.4
>

-- 
Yuri Volchkov
Software Specialist

NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg

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