diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-22 09:28:33 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-22 09:28:33 +0000 |
commit | e2fce743bd12f9865a2b5ce12a1275e13f51da40 (patch) | |
tree | 9b938c378a35f10e3397f518b2d570246452b83f /test/Scripts/macho-dump | |
parent | 124c5049b1234493b7c0a122a9b8803cc7f0b4d1 (diff) | |
download | external_llvm-e2fce743bd12f9865a2b5ce12a1275e13f51da40.zip external_llvm-e2fce743bd12f9865a2b5ce12a1275e13f51da40.tar.gz external_llvm-e2fce743bd12f9865a2b5ce12a1275e13f51da40.tar.bz2 |
llvm-mc: Hopefully fix Mach-O tests on big-endian platforms, force values to be
converted to Python ints if possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79736 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Scripts/macho-dump')
-rwxr-xr-x | test/Scripts/macho-dump | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/Scripts/macho-dump b/test/Scripts/macho-dump index d37b545..c41482c 100755 --- a/test/Scripts/macho-dump +++ b/test/Scripts/macho-dump @@ -37,7 +37,10 @@ class Reader: return struct.unpack('><'[self.isLSB] + 'H', self.read(2))[0] def read32(self): - return struct.unpack('><'[self.isLSB] + 'I', self.read(4))[0] + # Force to 32-bit, if possible; otherwise these might be long ints on a + # big-endian platform. FIXME: Why??? + Value = struct.unpack('><'[self.isLSB] + 'I', self.read(4))[0] + return int(Value) def registerStringTable(self, strings): if self.string_table is not None: |