diff mbox series

[kvm-unit-tests] s390x: Align __bss_end to a halfword boundary

Message ID 20230623093941.448147-1-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests] s390x: Align __bss_end to a halfword boundary | expand

Commit Message

Thomas Huth June 23, 2023, 9:39 a.m. UTC
We are using the "larl" instruction to load the address of __bss_end,
and this instruction can only deal with even addresses, so we have
to make sure that this symbol is aligned accordingly. Otherwise this
will cause a failure with the new binutils 2.40 and Clang:

 /usr/bin/ld: s390x/cstart64.o(.init+0x6a): misaligned symbol `__bss_end'
              (0x2c0d1) for relocation R_390_PC32DBL

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

Comments

Claudio Imbrenda June 26, 2023, 3:34 p.m. UTC | #1
On Fri, 23 Jun 2023 11:39:41 +0200
Thomas Huth <thuth@redhat.com> wrote:

> We are using the "larl" instruction to load the address of __bss_end,
> and this instruction can only deal with even addresses, so we have
> to make sure that this symbol is aligned accordingly. Otherwise this
> will cause a failure with the new binutils 2.40 and Clang:
> 
>  /usr/bin/ld: s390x/cstart64.o(.init+0x6a): misaligned symbol `__bss_end'
>               (0x2c0d1) for relocation R_390_PC32DBL
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> ---
>  s390x/flat.lds.S | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/s390x/flat.lds.S b/s390x/flat.lds.S
> index 0cb7e383..5e91ecac 100644
> --- a/s390x/flat.lds.S
> +++ b/s390x/flat.lds.S
> @@ -37,6 +37,7 @@ SECTIONS
>  	. = ALIGN(16);
>  	__bss_start = .;
>  	.bss : { *(.bss) }
> +	. = ALIGN(2);
>  	__bss_end = .;
>  	. = ALIGN(4K);
>  	edata = .;
diff mbox series

Patch

diff --git a/s390x/flat.lds.S b/s390x/flat.lds.S
index 0cb7e383..5e91ecac 100644
--- a/s390x/flat.lds.S
+++ b/s390x/flat.lds.S
@@ -37,6 +37,7 @@  SECTIONS
 	. = ALIGN(16);
 	__bss_start = .;
 	.bss : { *(.bss) }
+	. = ALIGN(2);
 	__bss_end = .;
 	. = ALIGN(4K);
 	edata = .;