]> Git Repo - J-linux.git/commitdiff
tools/nolibc: x86_64: use local label in memcpy/memmove
authorThomas Weißschuh <[email protected]>
Mon, 12 Aug 2024 20:50:19 +0000 (22:50 +0200)
committerThomas Weißschuh <[email protected]>
Fri, 16 Aug 2024 15:23:13 +0000 (17:23 +0200)
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 <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Thomas Weißschuh <[email protected]>
tools/include/nolibc/arch-x86_64.h

index 65252c005a3080d61fee382efeeeb2285f0276ea..1e40620a2b33da501b7e06dda2472903f7e2bfed 100644 (file)
@@ -193,10 +193,10 @@ __asm__ (
        "movq %rdi, %rdx\n\t"
        "subq %rsi, %rdx\n\t"
        "cmpq %rcx, %rdx\n\t"
-       "jb   .Lbackward_copy\n\t"
+       "jb   1f\n\t"
        "rep movsb\n\t"
        "retq\n"
-".Lbackward_copy:"
+"1:" /* backward copy */
        "leaq -1(%rdi, %rcx, 1), %rdi\n\t"
        "leaq -1(%rsi, %rcx, 1), %rsi\n\t"
        "std\n\t"
This page took 0.048312 seconds and 4 git commands to generate.