freebsd-skq/contrib/gcc/cp
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
..
call.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
ChangeLog Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
class.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
class.h Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
config-lang.in Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
cp-tree.h Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
cvt.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
decl2.c Import of 2.7.2.1 into vendor branch 1996-09-18 05:45:16 +00:00
decl.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
decl.h Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
edsel.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
errfn.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
error.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
except.c First round of changes to support generation of assembler for the old 1998-03-08 05:29:49 +00:00
expr.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
g++.1 Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
g++.c Remove temporary hack to disable use of libstdc++ now that it's built and 1996-10-04 08:51:18 +00:00
gc.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
gpcompare.texi Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
gxx.gperf Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
gxxint.texi My feeble attempt at fixing complaints that makeinfo makes about 1996-09-18 06:35:00 +00:00
init.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
input.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
lang-options.h Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
lang-specs.h Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
lex.c Import of 2.7.2.1 into vendor branch 1996-09-18 05:45:16 +00:00
lex.h Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
Make-lang.in Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
Makefile.in Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
method.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
parse.y Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
pt.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
ptree.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
reno.texi Make all the info dir entries line up neatly. 1997-05-28 07:49:21 +00:00
repo.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
search.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
sig.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
spew.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
templates.texi Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
tree.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
tree.def Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
typeck2.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
typeck.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00
xref.c Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the 1996-09-18 05:35:50 +00:00