Skip to contentSkip to conversation

crypto: arm64/poly1305 - move data to rodata section

PATCH In review Jia He 5 participants 8 messages Aug 6, 2024 – Aug 17, 2024

Subsystems (2)
lore
Share & tools
lore

Jia He

author
#0 lore raw

PATCH v2 1/1 crypto: arm64/poly1305 - move data to rodata section

When objtool gains support for ARM in the future, it may encounter issues disassembling the following data in the .text section:

Quoted 4 lines

.Lzeros:

.long   0,0,0,0,0,0,0,0
.asciz  "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
.align  2

Move it to .rodata which is a more appropriate section for read-only data.

There is a limit on how far the label can be from the instruction, hence use "adrp" and low 12bits offset of the label to avoid the compilation error.

---
v2:
- use adrp+offset to avoid compilation error(kernel test bot and Andy)
v1: https://lkml.org/lkml/2024/8/2/616

 arch/arm64/crypto/poly1305-armv8.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm64/crypto/poly1305-armv8.pl +5 -1
index cbc980fb02e3..22c9069c0650 100644
@@ -473,7 +473,8 @@ poly1305_blocks_neon:
 	subs	$len,$len,#64
 	ldp	x9,x13,[$inp,#48]
 	add	$in2,$inp,#96
-	adr	$zeros,.Lzeros
+	adrp	$zeros,.Lzeros
+	add	$zeros,$zeros,#:lo12:.Lzeros
 
 	lsl	$padbit,$padbit,#24
 	add	x15,$ctx,#48
@@ -885,10 +886,13 @@ poly1305_blocks_neon:
 	ret
 .size	poly1305_blocks_neon,.-poly1305_blocks_neon
 
+.pushsection .rodata
 .align	5
 .Lzeros:
 .long	0,0,0,0,0,0,0,0
 .asciz	"Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
+.popsection
+
 .align	2
 #if !defined(__KERNEL__) && !defined(_WIN64)
 .comm	OPENSSL_armcap_P,4,4
Signature · 1 line
2.34.1
#1 lore raw

On Tue, Aug 06, 2024 at 05:54:44AM GMT, Jia He wrote:

Hi Jia,

Quoted 37 lines

When objtool gains support for ARM in the future, it may encounter issues disassembling the following data in the .text section:

Quoted 4 lines

.Lzeros:

.long   0,0,0,0,0,0,0,0
.asciz  "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
.align  2

Move it to .rodata which is a more appropriate section for read-only data.

There is a limit on how far the label can be from the instruction, hence use "adrp" and low 12bits offset of the label to avoid the compilation error.

---
v2:
- use adrp+offset to avoid compilation error(kernel test bot and Andy)
v1: https://lkml.org/lkml/2024/8/2/616

 arch/arm64/crypto/poly1305-armv8.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm64/crypto/poly1305-armv8.pl +2 -1
index cbc980fb02e3..22c9069c0650 100644
@@ -473,7 +473,8 @@ poly1305_blocks_neon:
 	subs	$len,$len,#64
 	ldp	x9,x13,[$inp,#48]
 	add	$in2,$inp,#96
-	adr	$zeros,.Lzeros
+	adrp	$zeros,.Lzeros
+	add	$zeros,$zeros,#:lo12:.Lzeros
 
 	lsl	$padbit,$padbit,#24
 	add	x15,$ctx,#48

arch/arm64/crypto/poly1305-armv8.pl poly1305_blocks_neon: · line 895

Quoted 10 lines
arch/arm64/crypto/poly1305-armv8.pl +3 -0
@@ -885,10 +886,13 @@ poly1305_blocks_neon:
 	ret
 .size	poly1305_blocks_neon,.-poly1305_blocks_neon
 
+.pushsection .rodata
 .align	5
 .Lzeros:
 .long	0,0,0,0,0,0,0,0
 .asciz	"Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
+.popsection
+

I'm getting the following error with next-20240806

make LLVM=1 ARCH=arm64 allyesconfig
make LLVM=1 ARCH=arm64 -j$(nproc)

ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]

Full debug error with log context:

...
+ grep -q ^CONFIG_DEBUG_INFO_BTF=y include/config/auto.conf
+ strip_debug=1
+ vmlinux_link .tmp_vmlinux1
+ local output=.tmp_vmlinux1
+ local objs
+ local libs
+ local ld
+ local ldflags
+ local ldlibs
+ info LD .tmp_vmlinux1
+ printf %-7s %s\n LD .tmp_vmlinux1
LD .tmp_vmlinux1
+ shift
+ is_enabled CONFIG_LTO_CLANG
+ grep -q ^CONFIG_LTO_CLANG=y include/config/auto.conf
+ is_enabled CONFIG_X86_KERNEL_IBT
+ grep -q ^CONFIG_X86_KERNEL_IBT=y include/config/auto.conf
+ objs=vmlinux.a
+ libs=./drivers/firmware/efi/libstub/lib.a
+ is_enabled CONFIG_MODULES
+ grep -q ^CONFIG_MODULES=y include/config/auto.conf
+ objs=vmlinux.a .vmlinux.export.o
+ objs=vmlinux.a .vmlinux.export.o init/version-timestamp.o
+ [ arm64 = um ]
+ wl=
+ ld=ld.lld
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error
+ ldlibs=
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds
+ [ -n 1 ]
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds --strip-debug
+ is_enabled CONFIG_VMLINUX_MAP
+ grep -q ^CONFIG_VMLINUX_MAP=y include/config/auto.conf
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds --strip-debug -Map=.tmp_vmlinux1.map
+ ld.lld -EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds --strip-debug -Map=.tmp_vmlinux1.map -o .tmp_vmlinux1 --whole-archive vmlinux.a .vmlinux.export.o init/version-timestamp.o --no-whole-archive --start-group ./drivers/firmware/efi/libstub/lib.a --end-group .tmp_vmlinux0.kallsyms.o ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]
make[2]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make[1]: *** [/home/dagomez/src/linux-next/Makefile:1156: vmlinux] Error 2
make: *** [Makefile:224: __sub-make] Error 2

Any suggestion how to fix this?

Daniel

Quoted 6 lines
arch/arm64/crypto/poly1305-armv8.pl +0 -0
 .align	2
 #if !defined(__KERNEL__) && !defined(_WIN64)
 .comm	OPENSSL_armcap_P,4,4
Signature · 1 line
2.34.1
#2 lore raw
Quoted 44 lines · Daniel Gomez

On Tue, Aug 06, 2024 at 05:54:44AM GMT, Jia He wrote:

Hi Jia,

Quoted 40 lines

When objtool gains support for ARM in the future, it may encounter issues disassembling the following data in the .text section:

Quoted 4 lines

.Lzeros:

.long   0,0,0,0,0,0,0,0
.asciz  "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
.align  2

Move it to .rodata which is a more appropriate section for read-only data.

There is a limit on how far the label can be from the instruction, hence use "adrp" and low 12bits offset of the label to avoid the compilation error.

---
v2:
- use adrp+offset to avoid compilation error(kernel test bot and Andy)
v1: https://lkml.org/lkml/2024/8/2/616

 arch/arm64/crypto/poly1305-armv8.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm64/crypto/poly1305-armv8.pl +2 -1
index cbc980fb02e3..22c9069c0650 100644
@@ -473,7 +473,8 @@ poly1305_blocks_neon:
 	subs	$len,$len,#64
 	ldp	x9,x13,[$inp,#48]
 	add	$in2,$inp,#96
-	adr	$zeros,.Lzeros
+	adrp	$zeros,.Lzeros
+	add	$zeros,$zeros,#:lo12:.Lzeros
 
 	lsl	$padbit,$padbit,#24
 	add	x15,$ctx,#48
@@ -885,10 +886,13 @@ poly1305_blocks_neon:
 	ret
 .size	poly1305_blocks_neon,.-poly1305_blocks_neon
 
Quoted 9 lines

arch/arm64/crypto/poly1305-armv8.pl poly1305_blocks_neon: · line 895

Quoted 7 lines
arch/arm64/crypto/poly1305-armv8.pl +3 -0
+.pushsection .rodata
 .align	5
 .Lzeros:
 .long	0,0,0,0,0,0,0,0
 .asciz	"Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
+.popsection
+

I'm getting the following error with next-20240806

To clarify my report: the error below disappears when this patch is reverted.

Quoted 59 lines

make LLVM=1 ARCH=arm64 allyesconfig
make LLVM=1 ARCH=arm64 -j$(nproc)

ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]

Full debug error with log context:

...
+ grep -q ^CONFIG_DEBUG_INFO_BTF=y include/config/auto.conf
+ strip_debug=1
+ vmlinux_link .tmp_vmlinux1
+ local output=.tmp_vmlinux1
+ local objs
+ local libs
+ local ld
+ local ldflags
+ local ldlibs
+ info LD .tmp_vmlinux1
+ printf %-7s %s\n LD .tmp_vmlinux1
LD .tmp_vmlinux1
+ shift
+ is_enabled CONFIG_LTO_CLANG
+ grep -q ^CONFIG_LTO_CLANG=y include/config/auto.conf
+ is_enabled CONFIG_X86_KERNEL_IBT
+ grep -q ^CONFIG_X86_KERNEL_IBT=y include/config/auto.conf
+ objs=vmlinux.a
+ libs=./drivers/firmware/efi/libstub/lib.a
+ is_enabled CONFIG_MODULES
+ grep -q ^CONFIG_MODULES=y include/config/auto.conf
+ objs=vmlinux.a .vmlinux.export.o
+ objs=vmlinux.a .vmlinux.export.o init/version-timestamp.o
+ [ arm64 = um ]
+ wl=
+ ld=ld.lld
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error
+ ldlibs=
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds
+ [ -n 1 ]
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds --strip-debug
+ is_enabled CONFIG_VMLINUX_MAP
+ grep -q ^CONFIG_VMLINUX_MAP=y include/config/auto.conf
+ ldflags=-EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds --strip-debug -Map=.tmp_vmlinux1.map
+ ld.lld -EL -maarch64elf -z norelro -z noexecstack --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --pack-dyn-relocs=relr --orphan-handling=error --script=./arch/arm64/kernel/vmlinux.lds --strip-debug -Map=.tmp_vmlinux1.map -o .tmp_vmlinux1 --whole-archive vmlinux.a .vmlinux.export.o init/version-timestamp.o --no-whole-archive --start-group ./drivers/firmware/efi/libstub/lib.a --end-group .tmp_vmlinux0.kallsyms.o ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]
make[2]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make[1]: *** [/home/dagomez/src/linux-next/Makefile:1156: vmlinux] Error 2
make: *** [Makefile:224: __sub-make] Error 2

Any suggestion how to fix this?

Daniel

Quoted 6 lines
arch/arm64/crypto/poly1305-armv8.pl +0 -0
 .align	2
 #if !defined(__KERNEL__) && !defined(_WIN64)
 .comm	OPENSSL_armcap_P,4,4
Signature · 1 line
2.34.1
#3 lore raw
In reply to Daniel Gomez
Quoted 6 lines

I'm getting the following error with next-20240806

make LLVM=1 ARCH=arm64 allyesconfig
make LLVM=1 ARCH=arm64 -j$(nproc)

ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]

This looks like the original version of the path. At the very least the R_AARCH64_ADR_PREL_LO21 relocation is generated for the adr instruction. The v2 has adrp and add pair for which the relocations are R_AARCH64_ADR_PREL_PG_HI21 and R_AARCH64_ADD_ABS_LO12_NC.

Tested-by
#4 lore raw
Quoted 5 lines · Andy Polyakov
Quoted 5 lines

I'm getting the following error with next-20240806

make LLVM=1 ARCH=arm64 allyesconfig
make LLVM=1 ARCH=arm64 -j$(nproc)

Quoted 7 lines
Quoted 1 line

ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]

This looks like the original version of the path. At the very least the R_AARCH64_ADR_PREL_LO21 relocation is generated for the adr instruction. The v2 has adrp and add pair for which the relocations are R_AARCH64_ADR_PREL_PG_HI21 and R_AARCH64_ADD_ABS_LO12_NC.

I see, I thought v2 was already part of next-20240806 tag. Reverting v1 and applying v2 works for me. Thanks for clarifying.

Daniel

#5 lore raw
In reply to Daniel Gomez
Quoted 13 lines · Daniel Gomez
Quoted 7 lines · Jia He

When objtool gains support for ARM in the future, it may encounter issues disassembling the following data in the .text section:

Quoted 4 lines

.Lzeros:

.long   0,0,0,0,0,0,0,0
.asciz  "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
.align  2
Quoted 5 lines

Move it to .rodata which is a more appropriate section for read-only data.

There is a limit on how far the label can be from the instruction, hence use "adrp" and low 12bits offset of the label to avoid the compilation error.

Quoted 8 lines

[...]

I'm getting the following error with next-20240806

make LLVM=1 ARCH=arm64 allyesconfig
make LLVM=1 ARCH=arm64 -j$(nproc)

ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]

Hmmm, I ran into build problems with -next today for arm64 and x86-64 (ppc64le failed at a later stage for a different reason) on all current Fedora releases (yesterday everything worked fine). The error looks different, but mentions R_AARCH64_ADR_PREL_LO21 as well on arm64.

/usr/bin/ld: /tmp/ccgC3toO.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `stderr@@GLIBC_2.17' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /tmp/ccgC3toO.o(.text+0x8): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `stderr@@GLIBC_2.17'
/usr/bin/ld: final link failed: bad value

That's what brought be here, so allow me to ask: might that be related somehow or is that likely a different problem?

arm64: https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-39-aarch64/07889669-next-next-all/builder-live.log.gz
"""

Quoted 4 lines

+ /usr/bin/make -s 'HOSTCFLAGS=-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection ' 'HOSTLDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' ARCH=arm64 'KCFLAGS= ' WITH_GCOV=0 -j4 vmlinuz.efi
/usr/bin/ld: /tmp/ccgC3toO.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `stderr@@GLIBC_2.17' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /tmp/ccgC3toO.o(.text+0x8): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `stderr@@GLIBC_2.17'
/usr/bin/ld: final link failed: bad value

Quoted 8 lines

collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:47: /builddir/build/BUILD/kernel-next-20240808/linux-6.11.0-0.0.next.20240808.225.vanilla.fc39.aarch64/tools/bpf/resolve_btfids/fixdep] Error 1 make[3]: *** [/builddir/build/BUILD/kernel-next-20240808/linux-6.11.0-0.0.next.20240808.225.vanilla.fc39.aarch64/tools/build/Makefile.include:15: fixdep] Error 2 make[2]: *** [Makefile:76: bpf/resolve_btfids] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-next-20240808/linux-6.11.0-0.0.next.20240808.225.vanilla.fc39.aarch64/Makefile:1362: tools/bpf/resolve_btfids] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:226: __sub-make] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.iEcjn7 (%build)

"""

x86_64
https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-39-x86_64/07889669-next-next-all/builder-live.log.gz
"""

Quoted 11 lines

+ /usr/bin/make -s 'HOSTCFLAGS=-O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection ' 'HOSTLDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' ARCH=x86_64 'KCFLAGS= ' WITH_GCOV=0 -j2 bzImage
/usr/bin/ld: /tmp/ccSPE2cG.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:47: /builddir/build/BUILD/kernel-next-20240808/linux-6.11.0-0.0.next.20240808.225.vanilla.fc39.x86_64/tools/objtool/fixdep] Error 1 make[3]: *** [/builddir/build/BUILD/kernel-next-20240808/linux-6.11.0-0.0.next.20240808.225.vanilla.fc39.x86_64/tools/build/Makefile.include:15: fixdep] Error 2 make[2]: *** [Makefile:73: objtool] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-next-20240808/linux-6.11.0-0.0.next.20240808.225.vanilla.fc39.x86_64/Makefile:1362: tools/objtool] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:226: __sub-make] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.MPS2x4 (%build)

"""

Ciao, Thorsten

#6 lore raw
Quoted 10 lines · Thorsten Leemhuis
Quoted 9 lines · Daniel Gomez
Quoted 6 lines · Jia He

When objtool gains support for ARM in the future, it may encounter issues disassembling the following data in the .text section:

Quoted 4 lines

.Lzeros:

.long   0,0,0,0,0,0,0,0
.asciz  "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
.align  2

[...]

Quoted 8 lines
Quoted 6 lines

I'm getting the following error with next-20240806

make LLVM=1 ARCH=arm64 allyesconfig
make LLVM=1 ARCH=arm64 -j$(nproc)

ld.lld: error: vmlinux.a(arch/arm64/crypto/poly1305-core.o):(function poly1305_blocks_neon: .text+0x3d4): relocation R_AARCH64_ADR_PREL_LO21 out of range: 269166444 is not in [-1048576, 1048575]

Hmmm, I ran into build problems with -next today for arm64 and x86-64

Turned out my problem was caused by a different change:
https://lore.kernel.org/all/[email protected]/

Sorry for the noise.

Ciao, Thorsten

maintainer
#7 lore raw
In reply to Jia He
Quoted 13 lines · Jia He

When objtool gains support for ARM in the future, it may encounter issues disassembling the following data in the .text section:

Quoted 4 lines

.Lzeros:

.long   0,0,0,0,0,0,0,0
.asciz  "Poly1305 for ARMv8, CRYPTOGAMS by \@dot-asm"
.align  2

Move it to .rodata which is a more appropriate section for read-only data.

There is a limit on how far the label can be from the instruction, hence use "adrp" and low 12bits offset of the label to avoid the compilation error.

Quoted 8 lines

---
v2:
- use adrp+offset to avoid compilation error(kernel test bot and Andy)
v1: https://lkml.org/lkml/2024/8/2/616

 arch/arm64/crypto/poly1305-armv8.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt