[kvm-unit-tests PATCH] x86/flat.lds: Silence warnings about empty loadable segments

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

 



Recent versions of objcopy (e.g. from Fedora 37) complain:

 objcopy: x86/vmx.elf: warning: empty loadable segment detected at
  vaddr=0x400000, is this intentional?

Seems like we can silence these warnings by properly specifying
program headers in the linker script.

Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
---
 x86/flat.lds | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/x86/flat.lds b/x86/flat.lds
index 337bc44f..017a8500 100644
--- a/x86/flat.lds
+++ b/x86/flat.lds
@@ -1,18 +1,24 @@
+PHDRS
+{
+    text PT_LOAD FLAGS(5);
+    data PT_LOAD FLAGS(6);
+}
+
 SECTIONS
 {
     . = 4M + SIZEOF_HEADERS;
     stext = .;
-    .text : { *(.init) *(.text) *(.text.*) }
+    .text : { *(.init) *(.text) *(.text.*) } :text
     etext = .;
     . = ALIGN(4K);
     .data : {
           *(.data)
           exception_table_start = .;
           *(.data.ex)
-	  exception_table_end = .;
-	  }
+          exception_table_end = .;
+    } :data
     . = ALIGN(16);
-    .rodata : { *(.rodata) }
+    .rodata : { *(.rodata) } :data
     . = ALIGN(16);
     .bss : { *(.bss) }
     . = ALIGN(4K);
-- 
2.31.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux