Index: lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp =================================================================== --- lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp +++ lib/Target/MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp @@ -34,7 +34,7 @@ // Translate fixup kind to ELF relocation type. switch ((unsigned)Fixup.getKind()) { case FK_Data_1: return ELF::R_MSP430_8; - case FK_Data_2: return ELF::R_MSP430_16; + case FK_Data_2: return ELF::R_MSP430_16_BYTE; case FK_Data_4: return ELF::R_MSP430_32; case MSP430::fixup_32: return ELF::R_MSP430_32; case MSP430::fixup_10_pcrel: return ELF::R_MSP430_10_PCREL; Index: test/MC/MSP430/reloc.s =================================================================== --- test/MC/MSP430/reloc.s +++ test/MC/MSP430/reloc.s @@ -20,3 +20,8 @@ jmp foo ; CHECK: jmp foo ; encoding: [A,0b001111AA] ; CHECK: ; fixup A - offset: 0, value: foo, kind: fixup_10_pcrel + +; RUN: llvm-mc -filetype=obj -triple msp430 < %s | llvm-readobj -r \ +; RUN: | FileCheck -check-prefix=RELOC %s +.short _ctype+3 +; RELOC: R_MSP430_16_BYTE _ctype 0x3