Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 142584 Details for
Bug 284659
MachO Parser to handle 64bit binaries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Will fix the issue by adding the magic number for 64bit MachO binaries.
patch.txt (text/plain), 3.40 KB, created by
georg troxler
on 2009-07-25 12:45:10 EDT
(
hide
)
Description:
Will fix the issue by adding the magic number for 64bit MachO binaries.
Filename:
MIME Type:
Creator:
georg troxler
Created:
2009-07-25 12:45:10 EDT
Size:
3.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.core >Index: utils/org/eclipse/cdt/utils/macho/MachO.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/MachO.java,v >retrieving revision 1.12 >diff -u -r1.12 MachO.java >--- utils/org/eclipse/cdt/utils/macho/MachO.java 29 Apr 2008 17:24:44 -0000 1.12 >+++ utils/org/eclipse/cdt/utils/macho/MachO.java 25 Jul 2009 16:46:07 -0000 >@@ -54,7 +54,9 @@ > public final static int MH_MAGIC = 0xfeedface; /* the mach magic number */ > public final static int MH_CIGAM = 0xcefaedfe; > public final static int MH_UNIVERSAL = 0xcafebabe; >- >+ public final static int MH_MAGIC_64 = 0xfeedfacf; /* the mach magic number 64*/ >+ public final static int MH_CIGAM_64 = 0xcffaedfe; >+ > /* values of cputype */ > public final static int CPU_TYPE_ANY = -1; > public final static int CPU_TYPE_VAX = 1; >@@ -66,7 +68,8 @@ > public final static int CPU_TYPE_SPARC = 14; > public final static int CPU_TYPE_I860 = 15; > public final static int CPU_TYPE_POWERPC = 18; >- >+ public final static int CPU_TYPE_x86_64 = (0x01000000 | CPU_TYPE_I386); >+ > /* values of cpusubtype */ > public final static int CPU_SUBTYPE_MULTIPLE = -1; > public final static int CPU_SUBTYPE_LITTLE_ENDIAN = 0; >@@ -166,7 +169,7 @@ > efile.seek(0); > efile.setEndian(false); > magic = efile.readIntE(); >- if ( magic == MH_CIGAM ) >+ if ( magic == MH_CIGAM || magic == MH_CIGAM_64) > efile.setEndian(true); > else > if ( magic == MH_UNIVERSAL) >@@ -193,7 +196,7 @@ > } > } > } >- else if ( magic != MH_MAGIC ) >+ else if ( magic != MH_MAGIC && magic != MH_MAGIC_64) > throw new IOException(CCorePlugin.getResourceString("Util.exception.notMACHO")); //$NON-NLS-1$ > cputype = efile.readIntE(); > cpusubtype = efile.readIntE(); >@@ -207,7 +210,7 @@ > boolean isle = false; > int offset = 0; > magic = makeInt(bytes, offset, isle); offset += 4; >- if ( magic == MH_CIGAM ) >+ if ( magic == MH_CIGAM || magic == MH_CIGAM_64) > isle = true; > else > if ( magic == MH_UNIVERSAL) >@@ -234,7 +237,7 @@ > } > } > } >- else if ( magic != MH_MAGIC ) >+ else if ( magic != MH_MAGIC && magic != MH_MAGIC_64 ) > throw new IOException(CCorePlugin.getResourceString("Util.exception.notMACHO")); //$NON-NLS-1$ > cputype = makeInt(bytes, offset, isle); offset += 4; > cpusubtype = makeInt(bytes, offset, isle); offset += 4; >@@ -1054,6 +1057,9 @@ > case MachO.MachOhdr.CPU_TYPE_I860: > attrib.cpu = "i860"; //$NON-NLS-1$ > break; >+ case MachO.MachOhdr.CPU_TYPE_x86_64: >+ attrib.cpu = "x86_64"; //$NON-NLS-1$ >+ break; > case MachO.MachOhdr.CPU_TYPE_ANY: > default: > attrib.cpu = "any"; //$NON-NLS-1$ >@@ -1096,7 +1102,13 @@ > public static boolean isMachOHeader(byte[] bytes) { > try { > int magic = makeInt(bytes, 0, false); >- return (magic == MachO.MachOhdr.MH_MAGIC || magic == MachO.MachOhdr.MH_CIGAM || magic == MachO.MachOhdr.MH_UNIVERSAL); >+ boolean match = (magic == MachO.MachOhdr.MH_MAGIC ||magic == MachO.MachOhdr.MH_CIGAM || magic == MachO.MachOhdr.MH_UNIVERSAL); >+ if(match) >+ return true; >+ match = (match || magic == MachO.MachOhdr.MH_MAGIC_64 ||magic == MachO.MachOhdr.MH_CIGAM_64); >+ if(match) >+ return true; >+ return match; > } catch (IOException e) { > return false; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 284659
: 142584