Index: ELF/Arch/Hexagon.cpp =================================================================== --- ELF/Arch/Hexagon.cpp +++ ELF/Arch/Hexagon.cpp @@ -55,8 +55,23 @@ NoneRel = R_HEX_NONE; } -// Support V60 only at the moment. -uint32_t Hexagon::calcEFlags() const { return 0x60; } +static uint32_t getEFlags(InputFile *F) { + return cast>(F)->getObj().getHeader()->e_flags; +} + +uint32_t Hexagon::calcEFlags() const { + assert(!ObjectFiles.empty()); + + // The architecture revision must always be equal to or greater than + // greatest revision in the list of inputs. + uint32_t Target = 0; + for (InputFile *F : ObjectFiles) { + uint32_t EFlags = getEFlags(F); + if (EFlags > Target) + Target = EFlags; + } + return Target; +} static uint32_t applyMask(uint32_t Mask, uint32_t Data) { uint32_t Result = 0;