Subject: a patch for dynamic a.out support in binutils
To: None <>
From: Matthew Fredette <fredette@MIT.EDU>
List: tech-toolchain
Date: 08/02/2000 23:37:50
Hi -

I've been working on a patch for binutils to support the NetBSD
dynamic a.out format.  (a.out still has some life in it, right?
I think that several ports will still be using a.out in 1.5?)

I've finally gotten things to an interesting point.  By interesting, I
mean that under host i686-pc-linux-gnu, I have cross-linked a dynamic and a dynamic testglib for targets
m68k-sun-netbsd1.4 and vax-unknown-netbsd1.4.1, and the testglibs both
run successfully.

I started with the usr/src/gnu/dist from a Cheap*Bytes NetBSD 1.4 CD,
which appears to have the tag netbsd-1-4-RELEASE.  I have made two
versions of my patch.

This is an rdiff against those original sources:

This is a patch that should apply to a stock GNU binutils-2.9.1, and
add both the NetBSD changes and my changes:

Now for the disclaimers:

- This patch is being supplied by me with no warranty whatsoever.

- The only targets for which I have enabled the new support are
  m68k-*-netbsd* and vax-*-netbsd*.  Certain targets may require
  changes to that support, beyond just enabling it.

- This patch has not been heavily tested.

- Specifically, there may be fixes that I made to to various functions
  that handle standard relocs, that need to be propagated to functions
  that handle extended relocs.

- For now, ld generally creates impure executables, even on
  architectures where the native ld doesn't.

- Whenever ld misses the size of a symbol, it complains.

- ld doesn't generate copy relocations yet.

- The way I made this work might not be the best.  Roughly,
  bfd/netbsd.h now includes bfd/sunos.c, and the latter is now
  sensitive to various macros that make it read and write
  NetBSD dynamic structures.

There are certainly many other problems, but that's part of the reason
why I'm releasing it now - to get some feedback.



Matt Fredette,,
"If you understood everything I said, you'd be me."  - Miles Davis