Index: llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp =================================================================== --- llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp +++ llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp @@ -1338,10 +1338,7 @@ raw_ostream &O) { const MCOperand &Op = MI->getOperand(OpNum); - // If the label has already been resolved to an immediate offset (say, when - // we're running the disassembler), just print the immediate. if (Op.isImm()) { - O << "#" << formatImm(Op.getImm() * 4); return; } Index: llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.cpp =================================================================== --- llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.cpp +++ llvm/lib/Target/ARM/MCTargetDesc/ARMInstPrinter.cpp @@ -313,9 +313,7 @@ if (Op.isReg()) { unsigned Reg = Op.getReg(); printRegName(O, Reg); - } else if (Op.isImm()) { - O << markup(""); - } else { + } else if (!Op.isImm()) { assert(Op.isExpr() && "unknown operand kind in printOperand"); const MCExpr *Expr = Op.getExpr(); switch (Expr->getKind()) { Index: llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp =================================================================== --- llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp +++ llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp @@ -294,9 +294,7 @@ void X86InstPrinterCommon::printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O) { const MCOperand &Op = MI->getOperand(OpNo); - if (Op.isImm()) - O << formatImm(Op.getImm()); - else { + if (!Op.isImm()) { assert(Op.isExpr() && "unknown pcrel immediate operand"); // If a symbolic branch target was added as a constant expression then print // that address in hex. Index: llvm/test/tools/llvm-objdump/AArch64/pc-rel-targets.test =================================================================== --- llvm/test/tools/llvm-objdump/AArch64/pc-rel-targets.test +++ llvm/test/tools/llvm-objdump/AArch64/pc-rel-targets.test @@ -1,3 +1,3 @@ // RUN: llvm-objdump -d %p/Inputs/kextbundle.macho-aarch64 | FileCheck %s -CHECK: 4008: 03 00 00 94 bl #12 <_bar.stub> +CHECK: 4008: 03 00 00 94 bl 4014 <_bar.stub> Index: llvm/test/tools/llvm-objdump/ARM/invalid-instruction.s =================================================================== --- llvm/test/tools/llvm-objdump/ARM/invalid-instruction.s +++ llvm/test/tools/llvm-objdump/ARM/invalid-instruction.s @@ -5,5 +5,5 @@ .inst 0xffffffff l0: -@CHECK: 0: 00 00 00 ea b #0 +@CHECK: 0: 00 00 00 ea b 8 @CHECK-NEXT: 4: ff ff ff ff Index: llvm/test/tools/llvm-objdump/X86/coff-disassemble-export.test =================================================================== --- llvm/test/tools/llvm-objdump/X86/coff-disassemble-export.test +++ llvm/test/tools/llvm-objdump/X86/coff-disassemble-export.test @@ -2,7 +2,7 @@ // RUN: FileCheck %s // CHECK-LABEL: g: -// CHECK: calll 8 +// CHECK: calll 10001010 // CHECK-LABEL: f: -// CHECK: calll -24 +// CHECK: calll 10001000 Index: llvm/test/tools/llvm-objdump/X86/demangle.s =================================================================== --- llvm/test/tools/llvm-objdump/X86/demangle.s +++ llvm/test/tools/llvm-objdump/X86/demangle.s @@ -11,7 +11,7 @@ ## Check the case when relocations are inlined into disassembly. # RUN: llvm-objdump -d -r --demangle %t | FileCheck %s --check-prefix=INLINE # INLINE: foo(): -# INLINE-NEXT: 0: {{.*}} callq 0 <_Z3foov+0x5> +# INLINE-NEXT: 0: {{.*}} callq 5 <_Z3foov+0x5> # INLINE-NEXT: 0000000000000001: R_X86_64_PLT32 foo()-0x4 .text Index: llvm/test/tools/llvm-objdump/X86/elf-disassemble-no-symtab.test =================================================================== --- llvm/test/tools/llvm-objdump/X86/elf-disassemble-no-symtab.test +++ llvm/test/tools/llvm-objdump/X86/elf-disassemble-no-symtab.test @@ -8,7 +8,7 @@ # CHECK: Disassembly of section .text: # CHECK-EMPTY: # CHECK-NEXT: 0000000000004000 .text: -# CHECK-NEXT: 4000: e8 42 00 00 00 callq 66 <.text+0x47> +# CHECK-NEXT: 4000: e8 42 00 00 00 callq 4047 <.text+0x47> --- !ELF FileHeader: Index: llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test =================================================================== --- llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test +++ llvm/test/tools/llvm-objdump/X86/elf-disassemble-relocs.test @@ -4,10 +4,10 @@ # RUN: yaml2obj %s --docnum=1 -o %t1.o # RUN: llvm-objdump %t1.o -d -r | FileCheck %s --implicit-check-not="RELOCATION RECORDS" -# CHECK: 0: e8 00 00 00 00 callq 0 <.text+0x5> +# CHECK: 0: e8 00 00 00 00 callq 5 <.text+0x5> # CHECK-NEXT: 0000000000000001: R_X86_64_PC32 foo-0x4 # CHECK-NEXT: 0000000000000002: R_X86_64_NONE bar+0x8 -# CHECK-NEXT: 5: e8 00 00 00 00 callq 0 <.text+0xa> +# CHECK-NEXT: 5: e8 00 00 00 00 callq a <.text+0xa> # CHECK-NEXT: 0000000000000006: R_X86_64_PLT32 foo+0x1 --- !ELF Index: llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml =================================================================== --- llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml +++ llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml @@ -3,9 +3,9 @@ # RUN: llvm-objdump %t -d | FileCheck %s --check-prefix=EXEC # EXEC: Disassembly of section .text1: -# EXEC: 4000: e8 00 00 00 00 callq 0 +# EXEC: 4000: e8 00 00 00 00 callq 4005 # EXEC: Disassembly of section .text2: -# EXEC: 4005: e8 12 34 56 78 callq 2018915346 +# EXEC: 4005: e8 12 34 56 78 callq 7856741c --- !ELF FileHeader: @@ -48,17 +48,17 @@ # REL: Disassembly of section .text1: # REL-EMPTY: # REL-NEXT: 0000000000000000 .text1: -# REL-NEXT: 0: e8 00 00 00 00 callq 0 <.text1+0x5> +# REL-NEXT: 0: e8 00 00 00 00 callq 5 <.text1+0x5> # REL-EMPTY: # REL-NEXT: Disassembly of section .text2: # REL-EMPTY: # REL-NEXT: 0000000000000000 .text2: -# REL-NEXT: 0: e8 00 00 00 00 callq 0 +# REL-NEXT: 0: e8 00 00 00 00 callq 5 # REL-EMPTY: # REL-NEXT: Disassembly of section .text3: # REL-EMPTY: # REL-NEXT: 0000000000000000 .text3: -# REL-NEXT: 0: e8 00 00 00 00 callq 0 <.text3+0x5> +# REL-NEXT: 0: e8 00 00 00 00 callq 5 <.text3+0x5> --- !ELF FileHeader: Index: llvm/test/tools/llvm-objdump/X86/hex-displacement.test =================================================================== --- llvm/test/tools/llvm-objdump/X86/hex-displacement.test +++ llvm/test/tools/llvm-objdump/X86/hex-displacement.test @@ -3,4 +3,4 @@ # RUN: llvm-objdump -d %p/Inputs/hello.exe.macho-i386 | FileCheck %s -# CHECK: 1f47: e8 00 00 00 00 calll 0 <_main+0xc> +# CHECK: 1f47: e8 00 00 00 00 calll 1f4c <_main+0xc> Index: llvm/test/tools/llvm-objdump/X86/section-filter-relocs.test =================================================================== --- llvm/test/tools/llvm-objdump/X86/section-filter-relocs.test +++ llvm/test/tools/llvm-objdump/X86/section-filter-relocs.test @@ -10,7 +10,7 @@ # DISASM: Disassembly of section .text: # DISASM-EMPTY: # DISASM-NEXT: 0000000000000400 .text: -# DISASM-NEXT: 400: e8 00 00 00 00 callq 0 <.text+0x5> +# DISASM-NEXT: 400: e8 00 00 00 00 callq 405 <.text+0x5> # RELOC-NEXT: 00000401: R_X86_64_PC32 foo+0x1 # RELOC-NEXT: 00000401: R_X86_64_GOT32 foo # DISASM: Disassembly of section .rodata: Index: llvm/test/tools/llvm-objdump/call-absolute-symbol-elf.test =================================================================== --- llvm/test/tools/llvm-objdump/call-absolute-symbol-elf.test +++ llvm/test/tools/llvm-objdump/call-absolute-symbol-elf.test @@ -1,3 +1,3 @@ // REQUIRES: x86_64-linux // RUN: llvm-objdump --disassemble %p/Inputs/call-absolute-symbol.elf-x86_64 | FileCheck %s -CHECK: 201000: e8 fb f0 df ff callq -2100997 +CHECK: 201000: e8 fb f0 df ff callq 100 Index: llvm/tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- llvm/tools/llvm-objdump/llvm-objdump.cpp +++ llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1473,7 +1473,7 @@ --TargetSym; uint64_t TargetAddress = std::get<0>(*TargetSym); StringRef TargetName = std::get<1>(*TargetSym); - outs() << " <" << TargetName; + outs() << Twine::utohexstr(Target) << " <" << TargetName; uint64_t Disp = Target - TargetAddress; if (Disp) outs() << "+0x" << Twine::utohexstr(Disp);