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

[Minios-devel] [UNIKRAFT PATCH v4 1/3] build: disable build-id for libraries too



The option --build-id=none is enabled only for LDFLAGS, but not for
LIBLDFLAGS. This creates a section '.note.gnu.build-id' for every
library. This section makes it to the final image, and appears in a
random place in the ELF file.

Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
---
 Makefile.uk               | 2 +-
 plat/kvm/arm/link64.lds.S | 1 +
 plat/kvm/x86/link64.lds.S | 2 ++
 plat/xen/arm/link32.lds.S | 2 ++
 plat/xen/x86/link64.lds.S | 1 +
 5 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile.uk b/Makefile.uk
index 50dff8d2..c6cf2306 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -20,7 +20,7 @@ CXXINCLUDES += -nostdinc -nostdlib -I$(CONFIG_UK_BASE)/include
 # Set the text and data sections to be readable and writable. Also,
 # do not page-align the data segment. If the output format supports
 # Unix style magic numbers, mark the output as OMAGIC.
-LIBLDFLAGS  += -nostdinc -nostdlib -Wl,--omagic -Wl,-r -Wl,-d
+LIBLDFLAGS  += -nostdinc -nostdlib -Wl,--omagic -Wl,-r -Wl,-d 
-Wl,--build-id=none
 LDFLAGS     += -nostdinc -nostdlib -Wl,--omagic -Wl,--build-id=none
 
 CFLAGS-$(CONFIG_OPTIMIZE_NONE)            += -O0 -fno-optimize-sibling-calls 
-fno-tree-vectorize
diff --git a/plat/kvm/arm/link64.lds.S b/plat/kvm/arm/link64.lds.S
index 43aea4bd..8157271b 100644
--- a/plat/kvm/arm/link64.lds.S
+++ b/plat/kvm/arm/link64.lds.S
@@ -152,4 +152,5 @@ SECTIONS {
        }
 
        _end = .;
+       /DISCARD/ : { *(.note.gnu.build-id) }
 }
diff --git a/plat/kvm/x86/link64.lds.S b/plat/kvm/x86/link64.lds.S
index 9cad5e16..10951c21 100644
--- a/plat/kvm/x86/link64.lds.S
+++ b/plat/kvm/x86/link64.lds.S
@@ -93,4 +93,6 @@ SECTIONS
        }
 
        _end = .;
+
+       /DISCARD/ : { *(.note.gnu.build-id) }
 }
diff --git a/plat/xen/arm/link32.lds.S b/plat/xen/arm/link32.lds.S
index db26bf94..6b038411 100644
--- a/plat/xen/arm/link32.lds.S
+++ b/plat/xen/arm/link32.lds.S
@@ -143,4 +143,6 @@ SECTIONS
        .stab.index 0 : { *(.stab.index) }
        .stab.indexstr 0 : { *(.stab.indexstr) }
        .comment 0 : { *(.comment) }
+
+       /DISCARD/ : { *(.note.gnu.build-id) }
 }
diff --git a/plat/xen/x86/link64.lds.S b/plat/xen/x86/link64.lds.S
index 9823f469..76b33972 100644
--- a/plat/xen/x86/link64.lds.S
+++ b/plat/xen/x86/link64.lds.S
@@ -96,4 +96,5 @@ SECTIONS
                *(.exitcall.exit)
        }
        */
+       /DISCARD/ : { *(.note.gnu.build-id) }
 }
-- 
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®.