riscv-non-isa / riscv-asm-manual

RISC-V Assembly Programmer's Manual
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
1.44k stars 238 forks source link

unable to stop relaxation #36

Closed quantrpeter closed 4 years ago

quantrpeter commented 4 years ago

hi i am unable to stop relaxation using gnu gas

.option norelax
.section .text
.globl _start
label1:
_start:
    c.beqz  x8,label1
    c.beqz  x8,label2
lebal2:

riscv64-unknown-elf-as -march=rv32ifdc $? -o $@

output:

00000000 <_start>:
   0:   c001                    beqz    s0,0 <_start>
   2:   00041463           bnez    s0,a <lebal2>
   6:   ffbff06f                j       0 <_start>

Please help, why jump up (to label1) is ok, but jump down to label2 still has relaxation?

thanks Peter

jim-wilson commented 4 years ago

You misspelled label2. So it thinks it is a branch to a label in another file.

quantrpeter commented 4 years ago

sorry, so stupid