Commit Graph

300 Commits

Author SHA1 Message Date
steve
be4c09c465 Remove garbage initcode reference so that 'gcc -Dlint ...'
will compile without error.
1996-10-06 03:19:26 +00:00
peter
2242c2dae2 Support crt0 <-> ld.so interface version 4. This should be both backwards
and forwards compatable with version 3.  This is needed to enable storing
a run-time library path in the dynamic linking headers.  The crt startup
tries version 4 first, and falls back to version 3, so an executable that
is linked on -current will work with the ld.so on 2.1.x and less.

Reviewed by: nate, jdp
Obtained from: NetBSD
1996-10-01 00:54:48 +00:00
peter
d24d89b928 cmp -s || install -c --> install -C 1996-08-30 01:41:52 +00:00
wosch
9f795376b3 `mv'' -> `mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root
1996-05-07 23:19:49 +00:00
jdp
4cf4be8b5a Changed the dimensions of __CTOR_LIST__ and __DTOR_LIST__ from 0
to 2.  This makes them agree with the declarations in libgcc, and
clears the way once again for linking c++rt0.o into all libraries,
and eliminating CPLUSPLUSLIB from <bsd.lib.mk>.  (I have not made
that change yet, because there is still a bootstrapping problem
for "make world".)

Also, removed a check which ensured that the constructor count in
the first word of __CTOR_LIST__ was greater than zero before
traversing the list.  I had added that check earlier, but it is no
longer necessary, now that there is guaranteed to be at least 2
words in __CTOR_LIST__.
1996-02-20 04:07:26 +00:00
nate
33641076c5 Back out the thread_init code in order to allow -current to bootstrap
from -stable, until a better solution is found.

Submitted by:	Consensus of mailing list and the almighty Jordan :)
1996-01-30 05:55:20 +00:00
julian
619b731f5b Reviewed by: julian and (hsu?)
Submitted by:	 John Birrel(L?)

changes for threadsafe operations
1996-01-22 00:02:33 +00:00
jdp
83a650d90c Check the count in the first word of __CTOR_LIST__ before executing
the loop that invokes the static constructors.  That makes it safe
to link c++rt0.o into any shared library, even one that does not
have any static constructors.  Formerly, doing that would cause a
bus error.  If the library has no static constructors, __CTOR_LIST__
comes out as a simple 4-byte COMMON region, and it does not have
the usual NULL word that terminates the list of constructors.  This
caused the old code to "call" a garbage address via the non-existent
entry __CTOR_LIST__[1].

The analogous code that invokes the static destructors was already safe.

This change is fully backward-compatible.

Reviewed by:	dfr@render.com (Doug Rabson)
1996-01-15 17:53:25 +00:00
peter
c3f352d4ad This commit was generated by cvs2svn to compensate for changes in r13122,
which included commits to RCS files with non-trunk default branches.
1995-12-30 19:02:48 +00:00
peter
ab124e78b0 recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
ache
698e939e43 Remove my locale hack. Sigh. 1995-11-02 12:42:42 +00:00
phk
ec00c35383 Clean up and make code (more) readable. 1995-10-29 09:49:21 +00:00
bde
ef382ef7b6 Fixed dependencies for scrt0.o.
Build a static gcrt0.o (sgcrt0.o) too.  Currently only the dynamic gcrt0.o
is used, although -pg forces -static.
Sorted the .o targets.
1995-10-22 18:36:47 +00:00
phk
a026489209 -fomit-frame-pointer is becomming an increasingly popular optimization,
so before somebody screws up royally, make sure this always works by
adding a -fno-omit-frame-pointer here.
1995-10-20 20:05:15 +00:00
phk
361585330b put the _getenv and _strncmp under #ifdef DEBUG, which is the only time
they are used.  Saves a few bytes here and there, nothing major.
1995-10-18 15:56:55 +00:00
dg
aa55f7313a Create a scrt0.o file that specifically excludes the shared-lib support.
This will be used for -static programs.
1995-10-18 04:19:00 +00:00
nate
f12729acb8 Fixup the "ld.so failed" message for the case when ld.so finds undefined
symbols.

An easy example to see this is to develop an X program which links
against Xt, but doesn't add -lX11 to the link line.  It will link fine,
but cause run-time errors by ld.so because of missing symbols used by Xt
defined in X11.  This patch makes the errors more readable.

Submitted by:	jdp@polstra.com (John Polstra)
1995-09-27 23:13:33 +00:00
bde
1d5c50aac7 Install source files with the -c flag, not with the optional flag ${COPY}. 1995-08-06 12:37:41 +00:00
bde
6579f34131 Change install' to ${INSTALL}' so that default install flags can be
specified in the top level Makefiles.

Previously I missed dozens of Makefiles that skip the install after
using `cmp -s' to decide that the install isn't necessary.
1995-08-06 12:24:38 +00:00
wollman
ceb5359a6a Numerous Makefile fixes:
1) Do dependencies.
2) Install all appropriate links to manual pages.
3) Install header file in `beforeinstall' like all the rest.
4) Install header file only if changed.
5) Install object files only if changed.
1995-06-30 15:30:35 +00:00
dfr
6da3ef3223 Change ld.so to correctly load dependant libraries for dlopen and unload them
on dlclose.  Also correctly call constructors and destructors for libraries
linked with /usr/lib/c++rt0.o.
Change interpretation of dlopen manpage to call _init() rather than init()
for dlopened objects.
Change c++rt0.o to avoid using atexit to call destructors, allowing dlclose to
call destructors when an object is unloaded.
Change interface between crt0 and ld.so to allow crt0 to call a function on
exit to call destructors for shared libraries explicitly.

These changes are backwards compatible.  Old binaries will work with the new
ld.so and new binaries will work with the old ld.so.  A version number has
been introduced in the crt0-ld.so interface to allow for future changes.

Reviewed by:	GAWollman, Craig Struble <cstruble@singularity.bevc.blacksburg.va.us>
1995-06-27 09:53:27 +00:00
rgrimes
f05428e4cd Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
phk
3a58344a8b Install the dlopen.3 manpage. 1995-03-30 06:40:31 +00:00
phk
a96d1683ee Remove an unused variable. 1995-02-24 07:51:13 +00:00
jkh
a23ae9f606 Install the header files. 1995-02-09 08:00:20 +00:00
jkh
66c6af057e Add two parts of Mark's/Gary's dlopen() changes that I missed before. 1995-02-08 17:56:27 +00:00
jkh
dcc217c4ac Support for more Sun compatible dlopen() and friends. Also added proper error
handling.
Reviewed by:    gj
Submitted by:   Mark Diekhans <markd@grizzly.com>
1995-02-07 13:27:29 +00:00
ache
89b0add9b2 Call reduced (8-bit only) startup_setlocale() 1994-09-24 16:01:30 +00:00
ache
3d1858c2f0 Change level of setlocale hack enabling from compile option STARTUP_LOCALE
to check (via getenv) environment variable "ENABLE_STARTUP_LOCALE" at
runtime.
Submitted by: me per Bruce suggestion
1994-09-19 02:00:21 +00:00
ache
0de4aa5096 Add (#ifdef'ed by STARTUP_LOCALE) following line to crt0.c
(void) setlocale(LC_ALL, "");

It will be easiest way now to make national chars available
for all ctype-oriented programs at once by simple:

setenv LANG Your_National_Charset

Default case (without "LANG" environment
variable) will be fully ANSI compatible (got "C" locale).

If "LANG" variable present, extention becomes active.

Effect of this extention is great: in one time all ctype
oriented programs can accept/print national characters
without any touching source/binary code, it is big win, IMHO.

This method is fully compatible with ISO8859-* and russian koi8-r
too (in general -- with all 8-bit character sets). I think
it is very useful.
I got this idea from Xenix locale implementation.

This extention is even never compiled in, unless you set
	setenv STARTUP_LOCALE
before rebuilding crt0.c or corresponding variable in /etc/make.conf
1994-09-18 22:21:04 +00:00
bde
e1f08fe22b Remove dead code. gmon stuff is now done better in libc/gmon an
<machine/profile.h>.  The old version was writing an incomplete
header without the profrate field that is necessary to handle the
current faster profiling clock.  The counters that are where the
the profrate should be are usually 0 and gprof converts a profrate
of 0 to hz so the old version gave times too large by a factor of
profhz/hz = 10.24.
1994-08-22 15:13:41 +00:00
wollman
2751343523 Make it work with new mmap syscall. 1994-08-05 17:53:07 +00:00
rgrimes
d13b1c246f MAP_FILE is the default on mmap now, and is no longer defined just
like on a sun, so #define it to be 0 if we are running BSD >=199306.
1994-05-28 13:59:16 +00:00
nate
0dbc086d98 From Jordan via. Paul K.
This fixes the problems Warner's having with ctors not being called
again with the latest round of ld changes and updates the file-names to what
Paul is using now.

The name change will not affect anything as we are not (yet) using it.
1994-03-09 17:12:59 +00:00
nate
88cc102a4d Allow NetBSD (old style) shared binaries to work. Probably not the
final solution but at least this gets folks running -current up again.
1994-02-16 19:26:39 +00:00
jkh
7d6e9dc580 New dlopen, dlclose, etc al. For the new ld changes. 1994-02-13 20:53:11 +00:00
dg
d44d2d472f Implemented 'QMAGIC' a.out format correctly, and changed the default
output to be QMAGIC.
1994-01-03 18:35:54 +00:00
jkh
d7a06fc61f Adding embryonic C++ shared lib support (all tests positive so far). 1993-12-24 02:11:37 +00:00
ache
caec23e957 -r option incorrectly removed:
it is impossible to make gcrt0.o from moncrt0.o and gmon.o without it.
1993-11-18 00:08:03 +00:00
paul
dae4063bfb Removed all the ld -x -r stuff -- paranoia. 1993-11-16 02:22:16 +00:00
paul
fe43b03bfb shlib update:
Can get rid of local symbols with "ld -x -r" again.
Made LDSO #ifdef DEBUG.
1993-11-09 04:26:11 +00:00
paul
0d7b7c986d Removed install -d line since our install doesn't support the -d
option.
1993-11-07 03:05:40 +00:00
paul
4efaa0ebf8 Added shared libs support from NetBSD. 1993-11-04 01:09:18 +00:00
dg
c06d5da754 Yanked out the 8 'addb %al,%al' (0xc000)'s out of the start of the
program. The idea was that these are 'alignment' crap, but the image
is 16byte-aligned without these. Location 0 still doesn't have a 0,
but who cares, binaries wil be built with page zero unmapped in the
near future.
1993-10-26 09:04:13 +00:00
root
7048cfb1c8 Added ${COPY} knob to the install commands 1993-07-03 00:21:21 +00:00
nate
6d87a8d940 Added some support the new err(3) routines need
(Copied directly from NetBSD verbatim)
1993-06-29 04:34:12 +00:00
paul
03bdb6abfb Upgrade to GCC 2.X 1993-06-18 02:04:48 +00:00
rgrimes
bcfa18552e This commit was generated by cvs2svn to compensate for changes in r4,
which included commits to RCS files with non-trunk default branches.
1993-06-12 14:58:17 +00:00
rgrimes
48231afadc Initial import, 0.1 + pk 0.2.4-B1 1993-06-12 14:58:17 +00:00
rgrimes
e7bc108f0d Initial import, 0.1 + pk 0.2.4-B1 1993-06-12 14:58:17 +00:00