Mingjie Xing via llvm-dev
2016-Apr-12 00:56 UTC
[llvm-dev] [hexagon] bug fix for ELFHeaderEFlags
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
Rafael EspĂndola via llvm-dev
2016-Apr-24 14:21 UTC
[llvm-dev] [hexagon] bug fix for ELFHeaderEFlags
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 -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160424/19568102/attachment.html>
Mingjie Xing via llvm-dev
2016-Apr-25 03:37 UTC
[llvm-dev] [hexagon] bug fix for ELFHeaderEFlags
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>