[llvm-dev] [hexagon] bug fix for ELFHeaderEFlags

Mingjie Xing via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 24 20:37:40 PDT 2016


See the attachment for testcase.


2016-04-24 22:21 GMT+08:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
> Test case?
>
> On Apr 11, 2016 8:56 PM, "Mingjie Xing via llvm-dev"
> <llvm-dev at lists.llvm.org> wrote:
>>
>> Hello,
>>
>> I run into a problem that llvm can't write the correct ELFHeaderEFlags
>> for hexagonv4. The following patch can fix it.
>>
>> Index: lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
>> ===================================================================
>> --- lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp    (revision
>> 265917)
>> +++ lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp    (working
>> copy)
>> @@ -122,7 +122,7 @@
>>        : HexagonTargetStreamer(S) {
>>      auto Bits = STI.getFeatureBits();
>>      unsigned Flags;
>> -    if (Bits.to_ullong() & llvm::Hexagon::ArchV5)
>> +    if (Bits[Hexagon::ArchV5])
>>        Flags = ELF::EF_HEXAGON_MACH_V5;
>>      else
>>        Flags = ELF::EF_HEXAGON_MACH_V4;
>>
>> Maybe hexagon port maintainer has a better solution to handle
>> Hexagon::ArchV60 etc.
>>
>>
>> Best regards,
>> Mingjie
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elf-header-flags.ll
Type: application/octet-stream
Size: 150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160425/819d1219/attachment.obj>


More information about the llvm-dev mailing list