Skip to content

Commit 25fb329

Browse files
committed
tools/nolibc: x86_64: use local label in memcpy/memmove
Compiling arch-x86_64.h with clang and binutils LD yields duplicate label errors: .../gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: error: LLVM gold plugin: <inline asm>:44:1: symbol '.Lbackward_copy' is already defined .Lbackward_copy:leaq -1(%rdi, %rcx, 1), %rdi Instead of a local symbol use a local label which can be defined multiple times and therefore avoids the error. Reviewed-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20240812-nolibc-lto-v2-3-736af7bbefa8@weissschuh.net Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
1 parent ff7b9ab commit 25fb329

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/include/nolibc/arch-x86_64.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ __asm__ (
193193
"movq %rdi, %rdx\n\t"
194194
"subq %rsi, %rdx\n\t"
195195
"cmpq %rcx, %rdx\n\t"
196-
"jb .Lbackward_copy\n\t"
196+
"jb 1f\n\t"
197197
"rep movsb\n\t"
198198
"retq\n"
199-
".Lbackward_copy:"
199+
"1:" /* backward copy */
200200
"leaq -1(%rdi, %rcx, 1), %rdi\n\t"
201201
"leaq -1(%rsi, %rcx, 1), %rsi\n\t"
202202
"std\n\t"

0 commit comments

Comments
 (0)