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

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



Hi Yuri,

this seems to make sense, yes.

Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>

On 5/9/19 6:38 PM, Yuri Volchkov wrote:
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);


--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

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