[Lldb-commits] [PATCH] D19520: rL267291: Architecture change to thumb on parsing arm.attributes causes regression.

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 25 18:50:50 PDT 2016

omjavaid created this revision.
omjavaid added reviewers: tberghammer, labath.
omjavaid added a subscriber: lldb-commits.
Herald added subscribers: rengolin, aemerson.

rL267291 introduces a lot of regression on arm-linux by fixing module architecture to thumb if it finds thumb32 tag set.

Tag_THUMB_ISA_use, (=9), uleb128
2 32-bit Thumb instructions were permitted (implies 16-bit instructions permitted)

Does not mean that there wont be any arm instruction in current module. Therefore we can not set the architecture to thumb without knowing the value of

Tag_ARM_ISA_use, (=8), uleb128
0 The user did not permit this entity to use ARM instructions
1 The user intended that this entity could use ARM instructions

For most cases Tag_ARM_ISA_use, (=8), uleb128 will be set to 1 that will force us to use arm as our architecture instead of thumb.

I am removing this code for now may be we can come up with a better solution to get it over with.



Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1564,19 +1564,6 @@
-                case llvm::ARMBuildAttrs::THUMB_ISA_use:
-                {
-                    uint64_t ThumbISA = data.GetULEB128(&Offset);
-                    // NOTE: ignore ThumbISA == llvm::ARMBuildAttrs::AllowThumbDerived
-                    // since that derives it based on the architecutre/profile
-                    if (ThumbISA == llvm::ARMBuildAttrs::AllowThumb32)
-                        if (arch_spec.GetTriple().getArch() == llvm::Triple::UnknownArch ||
-                            arch_spec.GetTriple().getArch() == llvm::Triple::arm)
-                            arch_spec.GetTriple().setArch(llvm::Triple::thumb);
-                    break;
-                }
                 case llvm::ARMBuildAttrs::ABI_VFP_args:
                     uint64_t VFPArgs = data.GetULEB128(&Offset);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19520.54961.patch
Type: text/x-patch
Size: 1116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160426/754dfd12/attachment-0001.bin>

More information about the lldb-commits mailing list