Skip to content

[SPARC] llvm-objdump seem to mishandle backwards branches #122196

Closed
@koachan

Description

@koachan

llvm-objdump seems to treat negative branch offset as a large positive one, causing it to disassemble backwards branch in an odd way:

reproducer:
  nop
  ba reproducer
   nop

Assemble with e.g. clang -target sparc -c reproducer.s, then read it back:

$ bin/llvm-objdump -d reproducer.o 

reproducer.o:	file format elf32-sparc

Disassembly of section .text:

00000000 <reproducer>:
       0: 01 00 00 00  	nop
       4: 10 bf ff ff  	ba 4194303
       8: 01 00 00 00  	nop

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions