[ELF] Fix broken bitstream linking with lld when e_machine > 255
In ELF/InputFiles.cpp, getBitcodeMachineKind() is limited to uint8_t return type. This works as long as EM_xxx is < 256, which is true for common architectures, but not for some newly assigned or unofficial EM_* values. The corresponding ELF field (e_machine) can hold uint16_t. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D89185
This commit is contained in:
parent
8178e41dc1
commit
a9cefc3dee
|
@ -1517,7 +1517,7 @@ static ELFKind getBitcodeELFKind(const Triple &t) {
|
|||
return t.isArch64Bit() ? ELF64BEKind : ELF32BEKind;
|
||||
}
|
||||
|
||||
static uint8_t getBitcodeMachineKind(StringRef path, const Triple &t) {
|
||||
static uint16_t getBitcodeMachineKind(StringRef path, const Triple &t) {
|
||||
switch (t.getArch()) {
|
||||
case Triple::aarch64:
|
||||
return EM_AARCH64;
|
||||
|
|
Loading…
Reference in New Issue