mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
fixed elf parsing of 2G+ files
32 bit elf parser of 2G+ elf files does not read some field properties because it does signed extension when reading unsigned integer Change-Id: I64b47cc0849d4fb41daec258b2a595003b9de734
This commit is contained in:
parent
3f660b725b
commit
b08253b70a
2 changed files with 25 additions and 16 deletions
|
@ -56,10 +56,14 @@ public class ERandomAccessFile extends RandomAccessFile {
|
|||
val[3] = read();
|
||||
if ((val[0] | val[1] | val[2] | val[3]) < 0)
|
||||
throw new EOFException();
|
||||
long value;
|
||||
if ( isle ) {
|
||||
return ((val[3] << 24) + (val[2] << 16) + (val[1] << 8) + val[0]);
|
||||
value= ((val[3] << 24) + (val[2] << 16) + (val[1] << 8) + val[0]) ;
|
||||
} else{
|
||||
value= ((val[0] << 24) + (val[1] << 16) + (val[2] << 8) + val[3]);
|
||||
}
|
||||
return ((val[0] << 24) + (val[1] << 16) + (val[2] << 8) + val[3]);
|
||||
return value & 0x00000000ffffffffL;
|
||||
|
||||
}
|
||||
|
||||
public final long readLongE() throws IOException
|
||||
|
|
|
@ -84,7 +84,12 @@ public class ElfParser extends AbstractCExtension implements IBinaryParser {
|
|||
}
|
||||
} catch (IOException e) {
|
||||
if (hints == null) {
|
||||
binary = createBinaryArchive(path);
|
||||
try {
|
||||
binary = createBinaryArchive(path);
|
||||
} catch (IOException e2) {
|
||||
CCorePlugin.log(e); // log original exception
|
||||
throw e2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue