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

[PATCH v2 2/3] build32: don't discard .shstrtab in linker script


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 28 May 2020 16:40:22 +0200
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 28 May 2020 14:40:59 +0000
  • Ironport-sdr: n0X8arZrp+V6NldKp9SgBONEnoWCNEfodvtEjriYw2SWvek747YOBU8ZTr1bEibCB3W1RbTfCE hUjUStG/LOStGHyfxQArWMBR2RU1P2DoYgIMP/cqoYoRuMglw34XWImAhxfWzUf56qpnh1AjaL Kfn9ewuEATU/dLbzSI2Mb3X7rlVE8Eg48tY1u5SZJfvDbLOYFaiNsQ6Lpjym0wRwNavybmCdNJ +1tAs8q9NZGR+GVK9ySDQXshjbr/405zed5LGXWBWYc5GWYbA+H8S8RkZZGBgDpLceHDs8Lp1n bpM=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

LLVM linker doesn't support discarding .shstrtab, and complains with:

ld -melf_i386_fbsd -N -T build32.lds -o reloc.lnk reloc.o
ld: error: discarding .shstrtab section is not allowed

Add an explicit .shstrtab section to the linker script after the text
section in order to make LLVM LD happy.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/boot/build32.lds | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/x86/boot/build32.lds b/xen/arch/x86/boot/build32.lds
index 97454b40ff..5bd42ee4d9 100644
--- a/xen/arch/x86/boot/build32.lds
+++ b/xen/arch/x86/boot/build32.lds
@@ -50,6 +50,11 @@ SECTIONS
         *(.got.plt)
   }
 
+  .shstrtab : {
+        /* Discarding .shstrtab is not supported by LLD (LLVM LD). */
+        *(.shstrtab)
+  }
+
   /DISCARD/ : {
         /*
          * Discard everything else, to prevent linkers from putting
-- 
2.26.2




 


Rackspace

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