Skip to content

[llvm][Mips] Assembler does not assemble j $ra correctly for r6 #107460

Open
@alexrp

Description

@alexrp
❯ cat test.s
.global __start
__start:
    j $ra
❯ clang -target mipsisa64r6-linux-gnu -nostdlib test.s
❯ objdump --disassemble=__start a.out

a.out:     file format elf64-tradbigmips


Disassembly of section .text:

00000000000003f0 <__start>:
 3f0:   03e00008        .word   0x3e00008
 3f4:   00000000        nop
❯ mips64-linux-gnuabi64-gcc -march=mips64r6 -nostdlib test.s
❯ objdump --disassemble=__start a.out

a.out:     file format elf64-tradbigmips


Disassembly of section .text:

0000000120000150 <__start>:
   120000150:   03e00009        jr      ra
   120000154:   00000000        nop
        ...

It works fine for versions prior to r6.

This occurs in musl: https://git.musl-libc.org/cgit/musl/tree/crt/mips64/crtn.s

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions