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

[Minios-devel] [UNIKRAFT PATCH] build: protect constructors from elimination



Constructors do not work if CONFIG_OPTIMIZE_DEADELIM is enabled. From
the compile perspective all these functions are never called, so it is
in his right to remove them.

Let's instruct linker too keep the contents of .uk_ctortab* sections.

Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
 plat/common/x86/link64.lds | 2 +-
 plat/kvm/arm/link64.lds.S  | 2 +-
 plat/linuxu/arm/link.lds   | 2 +-
 plat/xen/arm/link32.lds    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plat/common/x86/link64.lds b/plat/common/x86/link64.lds
index a7ba67bb..96f353b8 100644
--- a/plat/common/x86/link64.lds
+++ b/plat/common/x86/link64.lds
@@ -53,7 +53,7 @@ __eh_frame_hdr_end = .;
 uk_ctortab = .;
 .uk_ctortab :
 {
-    *(SORT_BY_NAME(.uk_ctortab[0-7]))
+    KEEP(*(SORT_BY_NAME(.uk_ctortab[0-7])))
     LONG(0)
 }
 
diff --git a/plat/kvm/arm/link64.lds.S b/plat/kvm/arm/link64.lds.S
index f62b9a01..43aea4bd 100644
--- a/plat/kvm/arm/link64.lds.S
+++ b/plat/kvm/arm/link64.lds.S
@@ -103,7 +103,7 @@ SECTIONS {
        uk_ctortab = .;
        .uk_ctortab :
        {
-               *(SORT_BY_NAME(.uk_ctortab[0-7]))
+               KEEP(*(SORT_BY_NAME(.uk_ctortab[0-7])))
                LONG(0)
        }
 
diff --git a/plat/linuxu/arm/link.lds b/plat/linuxu/arm/link.lds
index 1dfda274..6f45fd8b 100644
--- a/plat/linuxu/arm/link.lds
+++ b/plat/linuxu/arm/link.lds
@@ -4,7 +4,7 @@ SECTIONS
    uk_ctortab = .;
    .uk_ctortab :
    {
-       *(SORT_BY_NAME(.uk_ctortab[0-7]))
+       KEEP(*(SORT_BY_NAME(.uk_ctortab[0-7])))
        LONG(0)
    }
 }
diff --git a/plat/xen/arm/link32.lds b/plat/xen/arm/link32.lds
index bc4e0dec..db26bf94 100644
--- a/plat/xen/arm/link32.lds
+++ b/plat/xen/arm/link32.lds
@@ -81,7 +81,7 @@ SECTIONS
        uk_ctortab = .;
        .uk_ctortab :
        {
-               *(SORT_BY_NAME(.uk_ctortab[0-7]))
+               KEEP(*(SORT_BY_NAME(.uk_ctortab[0-7])))
                LONG(0)
        }
        . = ALIGN(4096);
-- 
2.19.2


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