Issue 61412
Summary [RISCV] Clang-16 regressing build of inline assembly with Unsupported relocation type
Labels new issue
Assignees
Reporter kraj
    The example below has worked fine with clang-15 and also with clang16 branch of a week ago.

```c
#define XREF_NOTE \
 "" "\n"\
        "       .type _frr_xref_note,@object" "\n"\
        "       .pushsection .note.FRR,\"a\",@note"                        "\n"\
        " .p2align 2"                                                "\n"\
 "_frr_xref_note:" "\n"\
        "       .long   9" "\n"\
        "       .long   16" "\n"\
        "       .ascii  \"XREF\"" "\n"\
        "       .ascii \"FRRouting\\0\\0\\0\""                            "\n"\
 "       .quad   __start_xref_array-." "\n"\
        "       .quad   __stop_xref_array-." "\n"\
        "       .size _frr_xref_note, .-_frr_xref_note"                    "\n"\
        " .popsection"                                               "\n"\
 "" "\n"\

void foo(void) {
 asm(XREF_NOTE);
}
```

```
clang -target riscv64-yoe-linux -mlittle-endian b.c -c
b.c:18:7: error: Unsupported relocation type
 asm(XREF_NOTE);
      ^
b.c:11:3: note: expanded from macro 'XREF_NOTE'
        "       .quad   __start_xref_array-." "\n"\
         ^
<inline asm>:10:8: note: instantiated into assembly here
        .quad   __start_xref_array-.
 ^
b.c:18:7: error: Unsupported relocation type
 asm(XREF_NOTE);
      ^
b.c:12:3: note: expanded from macro 'XREF_NOTE'
        "       .quad   __stop_xref_array-." "\n"\
         ^
<inline asm>:11:8: note: instantiated into assembly here
        .quad   __stop_xref_array-.
 ^
2 errors generated.
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to