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

[MINI-OS PATCH] x86: have .note.Xen segment contents before other .note.* ones



Today the linker script of Mini-OS specifies to merge all .note*
sections into a single section .note:

 .note : {
          *(.note)
          *(.note.*)
  }

It seems as if ld will use the attributes of the first .note* segment
found during the linking process for the final .note segment.

Somewhere between binutils 2.43 and 2.45 something changed resulting in
.note.GNU-stack being the first .note* segment found. Unfortunately
this segment has unusual attributes: it has PROGBITS instead of NOTE as
type, resulting in the Xen ELF parsing to no longer look into it for
finding the Xen ELF-notes. This in turn will result in failure while
trying to parse the binary, which will let domain creation fail.

In order to avoid this issue, enhance the linker script to merge
.note.Xen before other .note.* segments, resulting in the final .note
segment to still have the NOTE type.

Fixes: 6d1cc81d049f ("x86: switch to use elfnote")
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 arch/x86/minios-x86.lds.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/minios-x86.lds.S b/arch/x86/minios-x86.lds.S
index 8c6e0a60..6367b4b2 100644
--- a/arch/x86/minios-x86.lds.S
+++ b/arch/x86/minios-x86.lds.S
@@ -33,6 +33,7 @@ SECTIONS
 
         .note : {
                 *(.note)
+                *(.note.Xen)
                 *(.note.*)
         }
 
-- 
2.51.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.