mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 00:16:25 +00:00
[Hexagon] Correctly set "Flags" in ELF header
llvm-svn: 267397
This commit is contained in:
parent
4181657e21
commit
18108f55f4
@ -157,10 +157,14 @@ public:
|
|||||||
HexagonTargetELFStreamer(MCStreamer &S, MCSubtargetInfo const &STI)
|
HexagonTargetELFStreamer(MCStreamer &S, MCSubtargetInfo const &STI)
|
||||||
: HexagonTargetStreamer(S) {
|
: HexagonTargetStreamer(S) {
|
||||||
auto Bits = STI.getFeatureBits();
|
auto Bits = STI.getFeatureBits();
|
||||||
unsigned Flags;
|
unsigned Flags = 0;
|
||||||
if (Bits.to_ullong() & llvm::Hexagon::ArchV5)
|
if (Bits[Hexagon::ArchV60])
|
||||||
|
Flags = ELF::EF_HEXAGON_MACH_V60;
|
||||||
|
else if (Bits[Hexagon::ArchV55])
|
||||||
|
Flags = ELF::EF_HEXAGON_MACH_V55;
|
||||||
|
else if (Bits[Hexagon::ArchV5])
|
||||||
Flags = ELF::EF_HEXAGON_MACH_V5;
|
Flags = ELF::EF_HEXAGON_MACH_V5;
|
||||||
else
|
else if (Bits[Hexagon::ArchV4])
|
||||||
Flags = ELF::EF_HEXAGON_MACH_V4;
|
Flags = ELF::EF_HEXAGON_MACH_V4;
|
||||||
getStreamer().getAssembler().setELFHeaderEFlags(Flags);
|
getStreamer().getAssembler().setELFHeaderEFlags(Flags);
|
||||||
}
|
}
|
||||||
|
9
test/MC/Hexagon/elf-flags.ll
Normal file
9
test/MC/Hexagon/elf-flags.ll
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
; RUN: llc -march=hexagon -mcpu=hexagonv4 --filetype=obj %s -o - | llvm-readobj -file-headers -elf-output-style=GNU | FileCheck --check-prefix=CHECK-V4 %s
|
||||||
|
; RUN: llc -march=hexagon -mcpu=hexagonv5 --filetype=obj %s -o - | llvm-readobj -file-headers -elf-output-style=GNU | FileCheck --check-prefix=CHECK-V5 %s
|
||||||
|
; RUN: llc -march=hexagon -mcpu=hexagonv55 --filetype=obj %s -o - | llvm-readobj -file-headers -elf-output-style=GNU | FileCheck --check-prefix=CHECK-V55 %s
|
||||||
|
; RUN: llc -march=hexagon -mcpu=hexagonv60 --filetype=obj %s -o - | llvm-readobj -file-headers -elf-output-style=GNU | FileCheck --check-prefix=CHECK-V60 %s
|
||||||
|
|
||||||
|
; CHECK-V4: Flags: 0x3
|
||||||
|
; CHECK-V5: Flags: 0x4
|
||||||
|
; CHECK-V55: Flags: 0x5
|
||||||
|
; CHECK-V60: Flags: 0x60
|
Loading…
Reference in New Issue
Block a user