diff mbox

[kvm-unit-tests] s390x: Remove .note.gnu.build-id section from the ELF files

Message ID 1529075737-5916-1-git-send-email-thuth@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Huth June 15, 2018, 3:15 p.m. UTC
While debugging another problem, we noticed that the low memory contains
some bytes which should not be there. Looks like the linker puts the
".note.gnu.build-id" section to address 0 if it has not explicitly
specified in the linker script. ARM and powerpc unit tests are apparently
already using --build-id=none to avoid this problem, so let's simply use
this linker flag in the s390x builds, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 s390x/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Janosch Frank June 18, 2018, 6:11 a.m. UTC | #1
On 15.06.2018 17:15, Thomas Huth wrote:
> While debugging another problem, we noticed that the low memory contains
> some bytes which should not be there. Looks like the linker puts the
> ".note.gnu.build-id" section to address 0 if it has not explicitly
> specified in the linker script. ARM and powerpc unit tests are apparently
> already using --build-id=none to avoid this problem, so let's simply use
> this linker flag in the s390x builds, too.

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
I'm all for predictable lowcore values :)

> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  s390x/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/s390x/Makefile b/s390x/Makefile
> index d4275a1..6546a02 100644
> --- a/s390x/Makefile
> +++ b/s390x/Makefile
> @@ -21,7 +21,7 @@ CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/s390x -I lib
>  CFLAGS += -O2
>  CFLAGS += -march=z900
>  CFLAGS += -fno-delete-null-pointer-checks
> -LDFLAGS += -nostdlib
> +LDFLAGS += -nostdlib -Wl,--build-id=none
>  
>  # We want to keep intermediate files
>  .PRECIOUS: %.o
>
David Hildenbrand June 18, 2018, 9:30 a.m. UTC | #2
On 15.06.2018 17:15, Thomas Huth wrote:
> While debugging another problem, we noticed that the low memory contains
> some bytes which should not be there. Looks like the linker puts the
> ".note.gnu.build-id" section to address 0 if it has not explicitly
> specified in the linker script. ARM and powerpc unit tests are apparently
> already using --build-id=none to avoid this problem, so let's simply use
> this linker flag in the s390x builds, too.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  s390x/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/s390x/Makefile b/s390x/Makefile
> index d4275a1..6546a02 100644
> --- a/s390x/Makefile
> +++ b/s390x/Makefile
> @@ -21,7 +21,7 @@ CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/s390x -I lib
>  CFLAGS += -O2
>  CFLAGS += -march=z900
>  CFLAGS += -fno-delete-null-pointer-checks
> -LDFLAGS += -nostdlib
> +LDFLAGS += -nostdlib -Wl,--build-id=none
>  
>  # We want to keep intermediate files
>  .PRECIOUS: %.o
> 

Maybe add a comment why this makes sense? But if the other archs use the
same trick, probably not worth it.

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox

Patch

diff --git a/s390x/Makefile b/s390x/Makefile
index d4275a1..6546a02 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -21,7 +21,7 @@  CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/s390x -I lib
 CFLAGS += -O2
 CFLAGS += -march=z900
 CFLAGS += -fno-delete-null-pointer-checks
-LDFLAGS += -nostdlib
+LDFLAGS += -nostdlib -Wl,--build-id=none
 
 # We want to keep intermediate files
 .PRECIOUS: %.o