This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: XCOFF64 bfd changes
On Fri, Apr 07, 2000 at 06:31:02PM -0700, Ian Lance Taylor wrote:
> Date: Fri, 7 Apr 2000 16:54:25 -0500
> From: Clinton Popetz <cpopetz@cygnus.com>
>
> *** bfd/coff-rs6000-64.c Wed Dec 31 18:00:00 1969
> --- bfd/coff-rs6000-64.c Wed Mar 29 13:50:20 2000
>
> Please use a different name which is unique in 8.3. Run doschk to
> check. We don't worry about it too much, but we might as well avoid
> adding yet another problem.
Ok.
> + #include "coff-rs6000.c"
>
> I don't like this approach. I know that BFD uses it a lot, for
> historical reasons. But this is another thing I'd rather we tried to
> avoid in new code.
>
> The way to do this is to use backend functions. I happen to like the
> ECOFF support, since I wrote pretty much all of it. We support two
> different kinds of ECOFF in different sizes without any bizarre file
> inclusion.
It isn't clear to me how I can reuse the code in coffcode.h without include
file weirdness, since coffcode.h knows about the coff structs directly. Do
you mean I should ignore coffcode.h and do a separate libxcoff.h/xcoff.c
modeled after ecoff.c? That would obviously be cleaner, but the presence
of coffcode.h, and the many of the coff backends use it, led me to believe
I should work within that framework.
> Adding ifdefs in this file is also problematical. It becomes harder
> to understand how to use the files in include/coff. These files are
> sometimes included by machine independent files. Most of the code in
> include/coff avoids ifdefs, with the exception of the PE support.
Ok, I wasn't aware of this. I'll move to two sets of structs, and macros to
pick the correct ones.
> Neither of these two issues are show-stoppers for this patch. But I
> strongly encourage you to discuss a possible design on the binutils
> list before implementing it.
Adding a new flavor of xcoff for use only by AIX seemed like something that
shouldn't require a lot of design, i.e. it was a variation on a theme that was
already there. I could have taken the opportunity to rewrite the xcoff code in
a cleaner fashion, but chose instead to work within the existing framework.
Primarily this was because I had no bfd experience, so I was hesitant to rip
out existing code.
-Clint