From: Marco Schlumpp Date: Wed, 12 Apr 2023 09:09:26 +0000 (+0200) Subject: build: Do not use segment annotations on linuxu X-Git-Tag: RELEASE-0.13.0~27 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4e139b3164bb4ead5cec2760ea0f3fd4aecb762c;p=unikraft%2Funikraft.git build: Do not use segment annotations on linuxu For the linuxu platform we rely on the default linker script and only add some additional sections on top of that one. That also means that there aren't any segments defined. This makes the segment specification opt-in instead of assuming the segments are always defined. Signed-off-by: Marco Schlumpp Checkpatch-Ignore: SPACING Checkpatch-Ignore: COMPLEX_MACRO Reviewed-by: Sergiu Moga Reviewed-by: Razvan Deaconescu Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #833 --- diff --git a/plat/common/include/uk/plat/common/common.lds.h b/plat/common/include/uk/plat/common/common.lds.h index 89ab444d1..df6dd4659 100644 --- a/plat/common/include/uk/plat/common/common.lds.h +++ b/plat/common/include/uk/plat/common/common.lds.h @@ -34,6 +34,16 @@ #include /* for __PAGE_SIZE */ +#ifdef UK_USE_SECTION_SEGMENTS +#define UK_SEGMENT_TLS :tls +#define UK_SEGMENT_TLS_LOAD :tls_load +#define UK_SEGMENT_DATA :data +#else +#define UK_SEGMENT_TLS +#define UK_SEGMENT_TLS_LOAD +#define UK_SEGMENT_DATA +#endif + /** Executable */ #define PHDRS_PF_X 0x1 /** Writeable */ @@ -134,7 +144,7 @@ *(.tdata) \ *(.tdata.*) \ *(.gnu.linkonce.td.*) \ - } :tls :tls_load \ + } UK_SEGMENT_TLS UK_SEGMENT_TLS_LOAD \ _etdata = .; \ .tbss : \ { \ @@ -160,7 +170,7 @@ { \ *(.data) \ *(.data.*) \ - } :data \ + } UK_SEGMENT_DATA \ _edata = .; \ \ /* \ diff --git a/plat/kvm/Makefile.uk b/plat/kvm/Makefile.uk index 6f4d37b83..786a7e3f7 100644 --- a/plat/kvm/Makefile.uk +++ b/plat/kvm/Makefile.uk @@ -26,9 +26,9 @@ LIBKVMPLAT_CINCLUDES-y += -I$(LIBKVMPLAT_BASE)/include LIBKVMPLAT_CINCLUDES-y += -I$(UK_PLAT_COMMON_BASE)/include LIBKVMPLAT_CINCLUDES-y += -I$(UK_PLAT_DRIVERS_BASE)/include -LIBKVMPLAT_ASFLAGS += -DKVMPLAT -LIBKVMPLAT_CFLAGS += -DKVMPLAT -LIBKVMPLAT_CXXFLAGS += -DKVMPLAT +LIBKVMPLAT_ASFLAGS += -DKVMPLAT -DUK_USE_SECTION_SEGMENTS +LIBKVMPLAT_CFLAGS += -DKVMPLAT -DUK_USE_SECTION_SEGMENTS +LIBKVMPLAT_CXXFLAGS += -DKVMPLAT -DUK_USE_SECTION_SEGMENTS ## ## Default Linker script diff --git a/plat/xen/Makefile.uk b/plat/xen/Makefile.uk index bc87ecf3e..386a52a4a 100644 --- a/plat/xen/Makefile.uk +++ b/plat/xen/Makefile.uk @@ -21,6 +21,10 @@ LIBXENPLAT_ASFLAGS-y += -DXENPLAT -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFAC LIBXENPLAT_CFLAGS-y += -DXENPLAT -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION) LIBXENPLAT_CXXFLAGS-y += -DXENPLAT -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION) +LIBXENPLAT_ASFLAGS-y += -DUK_USE_SECTION_SEGMENTS +LIBXENPLAT_CFLAGS-y += -DUK_USE_SECTION_SEGMENTS +LIBXENPLAT_CXXFLAGS-y += -DUK_USE_SECTION_SEGMENTS + ## ## Default Linker script ifeq ($(CONFIG_ARCH_X86_64),y)