This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] OMF support for BFD
- From: Bernd Jendrissek <bernd dot jendrissek at gmail dot com>
- To: david dot hagood at gmail dot com
- Cc: binutils at sourceware dot org
- Date: Tue, 20 Sep 2011 04:04:25 +0200
- Subject: Re: [PATCH] OMF support for BFD
- References: <babb80ac9e3bf99cf008239a7cb4cd3c.squirrel@localhost>
On Mon, Sep 19, 2011 at 4:54 PM, <david.hagood@gmail.com> wrote:
> Another toolchain to consider is Metaware's C++ compiler and the Pharlap
> linker (http://www.synopsys.com/dw/ipdir.php?ds=arc_metaware_compiler and
> http://www.intervalzero.com/). My employer uses them for embedded systems
> development, and I've been wanting to move us off to GCC, but lack of OMF
> has prevented that.
Yes, the Pharlap linker features in the MS document I was working
from. Some of its interpretations of OMF records conflict with the MS
/ Intel definitions, so I would like very much to see some sample
output files, to see if there's a way to auto-detect these variants.
> If you could get me some sample code I may be able to generate some test
> files for you - including a fully located embedded style OMF.
I can't possibly suggest sample code for every possible interesting
corner case, and in the absence of such an omni-example, I can only
ask for variety of files spotted in the wild.
As for the THREAD / FIXUP subrecord issue, I think a C snippet like
below should get those translators that do THREAD, to do so:
/* If possible, declare foo as a "far" function, and compile with
32-bit "large" memory model if using PharLap OMF. */
void foo(void); /* Defined in another translation unit. */
/* void far foo(void)? */
void (*bar(void))(void)
/* void (far *bar(void))(void)? */
{
/* Some arbitrary number of calls to the same function to trigger
THREAD-subrecord reloc optimization. */
foo();
foo();
foo();
foo();
foo();
return &foo; /* Odd-one-out relocation. */
}
/* Thanks in advance */