public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Issues with gcc -S output format
@ 2011-11-10  0:19 Kerrick Staley
  2011-11-10 13:19 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Kerrick Staley @ 2011-11-10  0:19 UTC (permalink / raw)
  To: gcc-help

Hello. I am designing a MIPS processor in VHDL as part of a class, and
I would like to compile and run several programs on this processor in
order to test them.

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)?

Thanks,
Kerrick Staley

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Issues with gcc -S output format
  2011-11-10  0:19 Issues with gcc -S output format Kerrick Staley
@ 2011-11-10 13:19 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2011-11-10 13:19 UTC (permalink / raw)
  To: Kerrick Staley; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-10  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-10  0:19 Issues with gcc -S output format Kerrick Staley
2011-11-10 13:19 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).