freebsd-nq/contrib
Peter Wemm 9cb13c2344 First round of changes to support generation of assembler for the old
a.out gas and the binutils gas (elf or a.out) with a single compiler.

This uses other infrastructure not yet committed, in order to support
both a.out and elf it needs to be able to get to both a.out and elf
gas, ld, libs, crt* etc.  So for now, the support is pretty much dormant.

The new freebsd.h file is based on the old freebsd-elf.h file (which has a
long lineage, right back through linux and svr4 files).  The change is
pretty dramatic from a gcc internals standpoint as it overrides a lot of
definitions in order to generate different output based on target mode.
There is potential for screw-ups, so please be on the lookout - gcc's
configuration mechanism wasn't really meant for this kind of thing.
It's believed to compile world etc just fine under both a.out and elf, can
handle global constructors and destructors, handles the differences in
a.out and elf stabs, and what sections things like exceptions go in.

The initial idea came from i386/osfrose.h which is a dual rose/elf format
target.  These two are not as diverse as a.out and elf it would seem.

The cc front-end uses external configuration to determine default object
format (still being thrashed out, so read the source if you want to see
it so far), and has a '-aout' and '-elf' override command line switch.
There are some other internal switches that can be accessed, namely -maout,
-mno-aout, -munderscores and -mnounderscores.  The underscore and local
symbol prefixing rules are controllable seperately to the output format.
(ie: it's possible to generate a.out without the _ prefixes on symbols and
also to generate elf with the _ prefixes.  This isn't quite optimal, but
does seem to work pretty well, except the linkers don't always recognise
the local symbols without their normal names)

The default format is a.out (still), nobody should see any major changes.

With both elf and a.out tools and libraries installed:

[1:26pm]/tmp-223> cc -elf -o hello hello.c
peter@beast[1:27pm]/tmp-224> file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped
[1:27pm]/tmp-225> ./hello
hello world!

[1:27pm]/tmp-226> cc -aout -o hello hello.c
[1:27pm]/tmp-227> file hello
hello: FreeBSD/i386 compact demand paged dynamically linked executable not stripped
1:27pm]/tmp-228> ./hello
hello world!

Since my co-conspirators put a lot of effort into this too, I'll add them
so they can share the blame^H^H^H^H^Hglory. :-)

Reviewed by: sos, jdp
1998-03-08 05:29:49 +00:00
..
awk Remove yet another superfluous file. 1997-10-26 12:53:16 +00:00
bind This commit was generated by cvs2svn to compensate for changes in r26971, 1997-06-27 07:25:32 +00:00
binutils Configuration changes to support FreeBSD. The linker only works for 1998-03-01 23:26:32 +00:00
bison Fix the location of the files in the FILES section. 1997-03-22 23:59:56 +00:00
cpio fix misspelling 1997-08-30 11:01:54 +00:00
cvs A hack to work around the sleep prior to calling the built-in diff. This 1998-02-14 09:47:14 +00:00
diff Some FreeBSD files to add... 1997-10-30 19:35:17 +00:00
gcc First round of changes to support generation of assembler for the old 1998-03-08 05:29:49 +00:00
gdb Fixed copying of N_TXTADDR() from the system version in the previous 1998-01-16 08:46:50 +00:00
global Add #include <string.h> to get prototypes. 1998-02-20 07:48:36 +00:00
gperf NetBSD has sys_errlist in errno.h, not stdio.h like FreeBSD. 1998-01-09 20:02:20 +00:00
groff Add OS macros for FreeBSD 2.2.6, OpenBSD 2.2, OpenBSD 2.3. 1997-12-28 18:20:05 +00:00
ipfilter Remove one last /etc/sysconfig reference. 1997-12-27 20:00:13 +00:00
libg++ Add a genclass.1 manpage. 1997-09-15 19:18:59 +00:00
libgmp This commit was generated by cvs2svn to compensate for changes in r34204, 1998-03-07 21:27:49 +00:00
libpcap Merge libpcap 0.3 1997-05-27 00:05:23 +00:00
libreadline Removed redundant declarations. Keymap functions are declared in 1998-01-16 09:12:05 +00:00
nvi Polish message catalogs for vi. 1997-09-22 23:14:37 +00:00
opie YTK fix. 1997-12-22 23:00:35 +00:00
patch Remove library funcs we already have 1998-01-04 20:45:41 +00:00
pnpinfo fix return type so that it returns both bytes (instead of just first) 1997-11-12 08:48:13 +00:00
tcl Resolve merge conflicts. 1997-11-27 19:52:45 +00:00
tcpdump Handle frame relay, decode ATM VP/VC info, and handle ISO over FR. 1998-01-01 04:13:54 +00:00
telnet MFC: sprintf paranoia 1998-01-22 00:04:57 +00:00
texinfo Don't print "Making info file ...' except in verbose mode. 1997-12-19 21:20:07 +00:00
top vmunix -> kernel 1998-01-13 14:17:10 +00:00
traceroute Fix an anomaly in the option descriptions. 1998-01-09 18:46:53 +00:00