[PATCH] D153097: [RISCV] Make linker-relaxable instructions terminate MCDataFragment

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 14:52:45 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/test/MC/ELF/RISCV/subsection.s:1-38
+# RUN: not llvm-mc -filetype=obj -triple=riscv64 -mattr=-relax %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=ERR,NORELAX --implicit-check-not=error:
+# RUN: not llvm-mc -filetype=obj -triple=riscv64 -mattr=+relax %s -o /dev/null 2>&1 | FileCheck %s --check-prefixes=ERR,RELAX --implicit-check-not=error:
 
 a:
   nop
 b:
   call foo at plt
----------------
nickdesaulniers wrote:
> riscv64-linux-gnu-as seems able to assemble this test case just fine. That's curious.
Yes, GNU assembler allows negative `.subsection` numbers but that we don't. 
The negative subsection numbers may be error-prone, so seems fine to reject.
Here I just use `.subsection` as a convenient feature to test the behavior of `evaluateAsAbsolute`...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153097/new/

https://reviews.llvm.org/D153097



More information about the llvm-commits mailing list