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

[xen master] x86/EFI: sections may not live at VA 0 in PE binaries



commit 940f22732ad1f018c87c8decf88b0efeaa3a2b0e
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Apr 26 10:24:20 2021 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Apr 26 10:24:20 2021 +0200

    x86/EFI: sections may not live at VA 0 in PE binaries
    
    PE binaries specify section addresses by (32-bit) RVA. GNU ld up to at
    least 2.36 would silently truncate the (negative) difference when a
    section is placed below the image base. Such sections would also be
    wrongly placed ahead of all "normal" ones. Since, for the time being,
    we build xen.efi with --strip-debug anyway, .stab* can't appear. And
    .comment has an entry in /DISCARD/ already anyway in the EFI case.
    
    Because of their unclear origin, keep the directives for the ELF case
    though.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/xen.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 5fadb02b7f..6346862250 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -350,6 +350,7 @@ SECTIONS
 #endif
   }
 
+#ifndef EFI
   /* Stabs debugging sections.  */
   .stab 0 : { *(.stab) }
   .stabstr 0 : { *(.stabstr) }
@@ -358,6 +359,7 @@ SECTIONS
   .stab.index 0 : { *(.stab.index) }
   .stab.indexstr 0 : { *(.stab.indexstr) }
   .comment 0 : { *(.comment) }
+#endif
 }
 
 ASSERT(__2M_rwdata_end <= XEN_VIRT_END - XEN_VIRT_START + __XEN_VIRT_START -
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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