Hi,
Is there a way to control the layout of the initialized data segment of a MACH-O binary?
The problem I'm having is that some code I am porting expects a static char array, followed by a char array to be in the order defined in the source code, but this isn't the case when compiled with Xcode. I know it sounds horrible (it is!), but the binary is scanned by an external app for copy protection purposes and these two buffers must be laid out correctly in order for it to work. I can't change it... and needless to say, the CodeWarrior (OS 9) and Windows versions don't have this problem.
So, to demonstrate, in the code I have (example, not real!):
static unsigned char gBuffer1[8] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; unsigned char gBuffer2[8] = { 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a'}; and the external app expects to see "abcdefghhgfedcba" in the data area of the binary.
Unfortunately, the resultant layout from an Xcode compile gives a binary with this:
"hgfedcba<lots of strings and other data here>abcdefgh"
For what it's worth, this is a Carbon app.
Any suggestions highly welcome!
Regards,
Martin Crane Macintosh Software Engineer Policing For Productivity ________________________________________________________ Vicomsoft is a dynamic market leader in Content Filtering, Internet Connectivity and Firewall Software, with an award-winning portfolio specifically designed for Mac OS X and Windows ________________________________________________________ |