Bug 303282 - endianness conversion routine bug
Summary: endianness conversion routine bug
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 6.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-19 02:50 EST by Siva Velusamy CLA
Modified: 2020-09-04 15:18 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Siva Velusamy CLA 2010-02-19 02:50:29 EST
In file org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java, the makeShort, makeInt, etc. routines are all buggy. They use arithmetic operations rather than logical operations to extract endian dependent values from a file.

e.g:

makeShort routine currently has:

return (short) ( (val[offset + 0] << 8) + val[offset + 1]);

But this should be:

short v2 = (short)(val[offset + 0] << 8;
return v2 | (val[offset+1] & 0xff);