[llvm] r222726 - [Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit
Simon Atanasyan
simon at atanasyan.com
Mon Nov 24 21:57:56 PST 2014
Author: atanasyan
Date: Mon Nov 24 23:57:55 2014
New Revision: 222726
URL: http://llvm.org/viewvc/llvm-project?rev=222726&view=rev
Log:
[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit
Added:
llvm/trunk/test/Object/Inputs/micro-mips.elf-mipsel (with props)
llvm/trunk/test/Object/Mips/objdump-micro-mips.test
Modified:
llvm/trunk/include/llvm/Object/ELFObjectFile.h
Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=222726&r1=222725&r2=222726&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Mon Nov 24 23:57:55 2014
@@ -280,8 +280,9 @@ std::error_code ELFObjectFile<ELFT>::get
const Elf_Ehdr *Header = EF.getHeader();
Result = ESym->st_value;
- // Clear the ARM/Thumb indicator flag.
- if (Header->e_machine == ELF::EM_ARM && ESym->getType() == ELF::STT_FUNC)
+ // Clear the ARM/Thumb or microMIPS indicator flag.
+ if ((Header->e_machine == ELF::EM_ARM || Header->e_machine == ELF::EM_MIPS) &&
+ ESym->getType() == ELF::STT_FUNC)
Result &= ~1;
if (Header->e_type == ELF::ET_REL)
Added: llvm/trunk/test/Object/Inputs/micro-mips.elf-mipsel
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/micro-mips.elf-mipsel?rev=222726&view=auto
==============================================================================
Binary files llvm/trunk/test/Object/Inputs/micro-mips.elf-mipsel (added) and llvm/trunk/test/Object/Inputs/micro-mips.elf-mipsel Mon Nov 24 23:57:55 2014 differ
Propchange: llvm/trunk/test/Object/Inputs/micro-mips.elf-mipsel
------------------------------------------------------------------------------
svn:executable = *
Added: llvm/trunk/test/Object/Mips/objdump-micro-mips.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/objdump-micro-mips.test?rev=222726&view=auto
==============================================================================
--- llvm/trunk/test/Object/Mips/objdump-micro-mips.test (added)
+++ llvm/trunk/test/Object/Mips/objdump-micro-mips.test Mon Nov 24 23:57:55 2014
@@ -0,0 +1,12 @@
+RUN: llvm-objdump -d -mattr=micromips %p/../Inputs/micro-mips.elf-mipsel \
+RUN: | FileCheck %s
+
+CHECK: foo:
+CHECK-NEXT: 330: bd 33 f8 ff addiu $sp, $sp, -8
+CHECK-NEXT: 334: dd fb 04 00 sw $fp, 4($sp)
+CHECK-NEXT: 338: 1d 00 50 f1 addu $fp, $sp, $zero
+
+CHECK: bar:
+CHECK-NEXT: 350: a2 41 02 00 lui $2, 2
+CHECK-NEXT: 354: 42 30 8f 80 addiu $2, $2, -32625
+CHECK-NEXT: 358: bd 33 e8 ff addiu $sp, $sp, -24
More information about the llvm-commits
mailing list