Commit f7be9fcc authored by Tobias Hunger's avatar Tobias Hunger

Abi: Fix detection of ELF files on big endian machines

Change-Id: I1301e463fc97fa9615398a2a120874c809975ae5
Reviewed-on: http://codereview.qt.nokia.com/647Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 386ce4f6
......@@ -34,6 +34,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QtEndian>
#include <QtCore/QFile>
#include <QtCore/QString>
#include <QtCore/QStringList>
......@@ -134,7 +135,10 @@ static QList<Abi> abiOf(const QByteArray &data)
&& static_cast<unsigned char>(data.at(0)) == 0x7f && static_cast<unsigned char>(data.at(1)) == 'E'
&& static_cast<unsigned char>(data.at(2)) == 'L' && static_cast<unsigned char>(data.at(3)) == 'F') {
// ELF format:
bool isLsbEncoded = (static_cast<quint8>(data.at(5)) == 1);
quint16 machine = (data.at(19) << 8) + data.at(18);
if (!isLsbEncoded)
machine = qFromBigEndian(machine);
quint8 osAbi = static_cast<quint8>(data.at(7));
Abi::OS os = Abi::UnixOS;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment