Issues with gcc -S output format

Ian Lance Taylor iant@google.com
Thu Nov 10 13:19:00 GMT 2011


Kerrick Staley <mail@kerrickstaley.com> writes:

> I can successfully compile the programs and convert them into a raw
> binary format for use with the processor I designed, but I now need to
> also run the programs on the MARS simulator in order to check the
> accuracy of my processor implementation.  The MARS simulator will only
> accept assembly source code as input (and not raw binary or object
> files), so I tried using -S to produce the assembly code for the
> programs. The problem is that MARS does not understand macros such as
> %lo and %hi (although it does have basic support for directives), so
> the code won't run. I also tried using objdump to disassemble the
> object file, but it inserts a bunch of extra junk such as instruction
> addresses.
>
> How can I get the raw assembly code in a simple format (that MARS can parse)?

I suppose you could try -mno-explicit-relocs.  I would not be at all
surprised if it no longer works, though, as I doubt anybody tests it.

Ian



More information about the Gcc-help mailing list