[llvm] [RISCV] Add Vendor Reloc and Fallback Names (PR #116974)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 11:57:48 PST 2024


================
@@ -0,0 +1,43 @@
+# RUN: llvm-mc -triple riscv32 < %s \
+# RUN:   | FileCheck -check-prefix=CHECK-ASM %s
+# RUN: llvm-mc -triple riscv64 < %s \
+# RUN:   | FileCheck -check-prefix=CHECK-ASM %s
+
+# RUN: llvm-mc -filetype=obj -triple riscv32 < %s \
+# RUN:   | llvm-objdump -dr -M no-aliases - \
+# RUN:   | FileCheck -check-prefix=CHECK-OBJ %s
+# RUN: llvm-mc -filetype=obj -triple riscv64 < %s \
+# RUN:   | llvm-objdump -dr -M no-aliases  - \
+# RUN:   | FileCheck -check-prefix=CHECK-OBJ %s
+
+  # CHECK-ASM: .text
+
+  # If `.set` is used instead, the relocation expression will be evaluated.
+  # This leaves an undef, global symbol called VENDOR_NAME, which I'm not happy
+  # about.
+  .global VENDOR_NAME
----------------
MaskRay wrote:

you can drop this `.globl`. Symbols only referenced by `.reloc` directives are emitted to .symtab as undefined symbols.

https://github.com/llvm/llvm-project/pull/116974


More information about the llvm-commits mailing list