Skip to contentSkip to conversation

tests: tcg: Fix PVH test with binutils 2.36+

PATCH Applied Cole Robinson 3 participants 3 messages Oct 8, 2021 – Oct 10, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: tcg: Fix PVH test with binutils 2.36+

binutils started adding a .note.gnu.property ELF section which makes the PVH test fail:

TEST hello on x86_64
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note

Discard .note.gnu* while keeping the PVH .note bits intact.

This also strips the build-id note, so drop the related comment.

---
 tests/tcg/x86_64/system/kernel.ld | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/tcg/x86_64/system/kernel.ld +4 -1
index 49c12b04ae..ca5d6bd850 100644
@@ -16,7 +16,10 @@ SECTIONS {
 		*(.rodata)
 	} :text
 
-        /* Keep build ID and PVH notes in same section */
+        /DISCARD/ : {
+                *(.note.gnu*)
+        }
+
         .notes :  {
                *(.note.*)
         } :note
Signature · 1 line
2.32.0
#1 lore raw
Quoted 22 lines · Cole Robinson

binutils started adding a .note.gnu.property ELF section which makes the PVH test fail:

TEST hello on x86_64
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note

Discard .note.gnu* while keeping the PVH .note bits intact.

This also strips the build-id note, so drop the related comment.

---
  tests/tcg/x86_64/system/kernel.ld | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
tests/tcg/x86_64/system/kernel.ld +0 -0
index 49c12b04ae..ca5d6bd850 100644
@@ -16,7 +16,10 @@ SECTIONS {
  		*(.rodata)

tests/tcg/x86_64/system/kernel.ld SECTIONS { · line 25

Quoted 10 lines
tests/tcg/x86_64/system/kernel.ld +4 -1
  	} :text
 
-        /* Keep build ID and PVH notes in same section */
+        /DISCARD/ : {
+                *(.note.gnu*)
+        }
+
          .notes :  {
                 *(.note.*)
          } :note

Queued, thanks.

Paolo

Acked-by on v1 1/1
#2 lore raw
In reply to Cole Robinson
Quoted 11 lines · Cole Robinson

binutils started adding a .note.gnu.property ELF section which makes the PVH test fail:

TEST hello on x86_64
qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note

Discard .note.gnu* while keeping the PVH .note bits intact.

This also strips the build-id note, so drop the related comment.

Signature · 1 line
Alex Bennée