This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Some questions about big endian on a PC with Redhat.


Hi, gcc,

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!

Yours,
Liu Xiaochao
2001-08-13 10:54:33


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]