]> git.ipfire.org Git - thirdparty/qemu.git/commit
pc-bios/s390-ccw: Don't generate TEXTRELs
authorJens Remus <jremus@linux.ibm.com>
Tue, 1 Oct 2024 15:36:17 +0000 (17:36 +0200)
committerThomas Huth <thuth@redhat.com>
Wed, 23 Oct 2024 04:53:44 +0000 (06:53 +0200)
commit3259b4424a85d9cdfd1a33ed6030a6c51c1b9b8b
treec2638fa68a7861ef3e8b98f53c159e2abf84a728
parentc58df213af7ec8924d219025a593b8f3ac475f16
pc-bios/s390-ccw: Don't generate TEXTRELs

Commit 7cd50cbe4ca3 ("pc-bios/s390-ccw: Don't use __bss_start with the
"larl" instruction") introduced the address constant bss_start_literal
for __bss_start in the .text section, which introduced a relocation in
code (i.e. TEXTREL). The dedicated constant is required, as __bss_start
may not necessarily be aligned on a 2-byte boundary (see subject commit
for details).

Move the constant to the .data section to get rid of the relocation in
the .text section. Add the linker option -z text to prevent TEXTRELs to
get introduced in the future.

Note that the R_390_RELATIVE relocations are taken care of by function
glue() in include/hw/elf_ops.h.inc introduced by commit 5dce07e1cb67
("elf-loader: Provide the possibility to relocate s390 ELF files").

Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Message-ID: <20241001153618.17791-3-mhartmay@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
pc-bios/s390-ccw/Makefile
pc-bios/s390-ccw/start.S