Index: llvm/include/llvm/Object/ELFObjectFile.h =================================================================== --- llvm/include/llvm/Object/ELFObjectFile.h +++ llvm/include/llvm/Object/ELFObjectFile.h @@ -552,18 +552,7 @@ Expected SymOrErr = getSymbol(Symb); if (!SymOrErr) report_fatal_error(SymOrErr.takeError()); - - uint64_t Ret = (*SymOrErr)->st_value; - if ((*SymOrErr)->st_shndx == ELF::SHN_ABS) - return Ret; - - const Elf_Ehdr &Header = EF.getHeader(); - // Clear the ARM/Thumb or microMIPS indicator flag. - if ((Header.e_machine == ELF::EM_ARM || Header.e_machine == ELF::EM_MIPS) && - (*SymOrErr)->getType() == ELF::STT_FUNC) - Ret &= ~1; - - return Ret; + return (*SymOrErr)->st_value; } template Index: llvm/test/tools/llvm-nm/ARM/address-check.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-nm/ARM/address-check.test @@ -0,0 +1,26 @@ +## Test for function type symbols with odd valued addresses have the correct +## value on ARM. +# +# RUN: yaml2obj %s -o %t +# RUN: llvm-nm %t | FileCheck %s + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_ARM + Flags: [ EF_ARM_EABI_VER5 ] +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x4 +Symbols: + - Name: foo + Value: 0x1003 + Section: .text + Type: STT_FUNC + Binding: STB_GLOBAL + +# CHECK: 00001003 T foo