diff options
author | jdp <jdp@FreeBSD.org> | 1996-01-15 17:53:25 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1996-01-15 17:53:25 +0000 |
commit | 83a650d90c7424446b3b768820ba6def8b151593 (patch) | |
tree | aaf9386dd73c53d4496e061a04769e110b4e26b3 /games | |
parent | ad0d6ac8dbc83a7e965ca6a28eb4ae8e5822cec9 (diff) | |
download | FreeBSD-src-83a650d90c7424446b3b768820ba6def8b151593.zip FreeBSD-src-83a650d90c7424446b3b768820ba6def8b151593.tar.gz |
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)
Diffstat (limited to 'games')
0 files changed, 0 insertions, 0 deletions