[PATCH] tests: tcg: Fix PVH test with binutils 2.36+

Cole Robinson posted 1 patch 2 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/5ab2a54c262c61f64c22dbb49ade3e2db8a740bb.1633708346.git.crobinso@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Richard Henderson <richard.henderson@linaro.org>
tests/tcg/x86_64/system/kernel.ld | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[PATCH] tests: tcg: Fix PVH test with binutils 2.36+
Posted by Cole Robinson 2 years, 6 months ago
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.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 tests/tcg/x86_64/system/kernel.ld | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/tcg/x86_64/system/kernel.ld b/tests/tcg/x86_64/system/kernel.ld
index 49c12b04ae..ca5d6bd850 100644
--- a/tests/tcg/x86_64/system/kernel.ld
+++ b/tests/tcg/x86_64/system/kernel.ld
@@ -16,7 +16,10 @@ SECTIONS {
 		*(.rodata)
 	} :text
 
-        /* Keep build ID and PVH notes in same section */
+        /DISCARD/ : {
+                *(.note.gnu*)
+        }
+
         .notes :  {
                *(.note.*)
         } :note
-- 
2.32.0


Re: [PATCH] tests: tcg: Fix PVH test with binutils 2.36+
Posted by Paolo Bonzini 2 years, 6 months ago
On 08/10/21 18:21, Cole Robinson wrote:
> 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.
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>   tests/tcg/x86_64/system/kernel.ld | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/tcg/x86_64/system/kernel.ld b/tests/tcg/x86_64/system/kernel.ld
> index 49c12b04ae..ca5d6bd850 100644
> --- a/tests/tcg/x86_64/system/kernel.ld
> +++ b/tests/tcg/x86_64/system/kernel.ld
> @@ -16,7 +16,10 @@ SECTIONS {
>   		*(.rodata)
>   	} :text
>   
> -        /* Keep build ID and PVH notes in same section */
> +        /DISCARD/ : {
> +                *(.note.gnu*)
> +        }
> +
>           .notes :  {
>                  *(.note.*)
>           } :note
> 

Queued, thanks.

Paolo


Re: [PATCH] tests: tcg: Fix PVH test with binutils 2.36+
Posted by Alex Bennée 2 years, 6 months ago
Cole Robinson <crobinso@redhat.com> writes:

> 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.
>
> Signed-off-by: Cole Robinson <crobinso@redhat.com>

Acked-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée