This is the mail archive of the
mailing list for the GCC project.
Some questions about big endian on a PC with Redhat.
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Subject: Some questions about big endian on a PC with Redhat.
- From: Liu Xiaochao <super6 at start dot com dot cn>
- Date: Mon, 13 Aug 2001 11:56:25 +0800
- CC: ÍõÏþ·å <wxf at start dot com dot cn>
- Organization: Thin-Client Research Division, Start Network Technology CO.,LTD.
- Reply-To: super6 at start dot com dot cn
Above all, I'd like to thank you for having help me out on building an m68k cross-compiler. But, I am now facing some new problems about big endian on an Intel PC(which suppose to be little-endian) with Redhat6.2.
I want to use the m68k cross-compiler on my THIS PC to build a program which will be run on an m68k platform in the future. I follow the following steps:
1. Use m68k cross-compiler to build an AOUT temp file, as foo.aout.temp,
2. Use a relocating program which is built with the original GCC on the PC to relocate the above AOUT file, foo.aout.temp, and the output file is to be foo.aout.temp.reloc,
3. Put another section of relocating program built with m68k cross-compiler into the relocated file, foo.aout.temp.reloc, and the output file is to be foo.aout.relocbin.
4. Load the binary file, foo.aout.reloc, to an m68k platform, where the program will run.
I have carried out only the first step. And the following questions hold me back:
1. I can not accomplish the relocation because of the big-endian property of foo.aout.temp. And after I manually converted some long variables using ntohl(), I was pulled further. Maybe this method is somewhat foolish. I want to ask you whether there are options in GCC can automatically do such converting tasks for me as ARM.
2. I am afraid that the file output by the relocating program would not run on our target platform. m68k. Can you interpret it?
3. Can you give me some advices on handling my circumstance?
Thank you and with my best wish to you!