<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdlib/atexit.c, branch releng/14.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:42+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1d386b48a555f61cb7325543adbbb5c3f3407a66'/>
<id>1d386b48a555f61cb7325543adbbb5c3f3407a66</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix order of destructors between main binary and libraries.</title>
<updated>2019-04-15T13:03:09+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2019-04-15T13:03:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=760e34772c0379e27aebf4021f095585446ea282'/>
<id>760e34772c0379e27aebf4021f095585446ea282</id>
<content type='text'>
Since inits for the main binary are run from rtld (for some time), the
rtld_exit atexit(3) handler, which is passed from rtld to the program
entry and installed by csu, is installed after any atexit(3) handlers
installed by main binary constructors.  This means that rtld_exit() is
fired before main binary handlers.

Typical C++ static constructors are executed from init (either binary
or libs) but use atexit(3) to ensure that destructors are called in
the right order, independent of the linking order.  Also, C++
libraries finalizers call __cxa_finalize(3) to flush library'
atexit(3) entries.  Since atexit(3) entry is cleared after being run,
this would be mostly innocent, except that, atexit(rtld_exit) done
after main binary constructors, makes destructors from libraries
executed before destructors for main.

Fix by reordering atexit(rtld_exit) before inits for main binary, same
as it happened when inits were called by csu.  Do it using new private
libc symbol with pre-defined ABI.

Reported. tested, and reviewed by:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since inits for the main binary are run from rtld (for some time), the
rtld_exit atexit(3) handler, which is passed from rtld to the program
entry and installed by csu, is installed after any atexit(3) handlers
installed by main binary constructors.  This means that rtld_exit() is
fired before main binary handlers.

Typical C++ static constructors are executed from init (either binary
or libs) but use atexit(3) to ensure that destructors are called in
the right order, independent of the linking order.  Also, C++
libraries finalizers call __cxa_finalize(3) to flush library'
atexit(3) entries.  Since atexit(3) entry is cleared after being run,
this would be mostly innocent, except that, atexit(rtld_exit) done
after main binary constructors, makes destructors from libraries
executed before destructors for main.

Fix by reordering atexit(rtld_exit) before inits for main binary, same
as it happened when inits were called by csu.  Do it using new private
libc symbol with pre-defined ABI.

Reported. tested, and reviewed by:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>General further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-20T19:49:47+00:00</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-20T19:49:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8a16b7a18f5d0b031f09832fd7752fba717e2a97'/>
<id>8a16b7a18f5d0b031f09832fd7752fba717e2a97</id>
<content type='text'>
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove names from prototypes</title>
<updated>2015-09-20T20:15:44+00:00</updated>
<author>
<name>Craig Rodrigues</name>
<email>rodrigc@FreeBSD.org</email>
</author>
<published>2015-09-20T20:15:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=48d59c227051de4ae19dffe34f43e9f9734ada2b'/>
<id>48d59c227051de4ae19dffe34f43e9f9734ada2b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add declarations to eliminate -Wmissing-prototypes warnings.</title>
<updated>2015-09-20T03:53:08+00:00</updated>
<author>
<name>Craig Rodrigues</name>
<email>rodrigc@FreeBSD.org</email>
</author>
<published>2015-09-20T03:53:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8d3aa83d8bb194f847d759f83f0da74c69673fd3'/>
<id>8d3aa83d8bb194f847d759f83f0da74c69673fd3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Silence a warning with GCC that was breaking the build with Juniper's GCC.</title>
<updated>2014-04-05T08:17:48+00:00</updated>
<author>
<name>David Chisnall</name>
<email>theraven@FreeBSD.org</email>
</author>
<published>2014-04-05T08:17:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c8aeb6b44755c6f6773a5e15958759adb623692c'/>
<id>c8aeb6b44755c6f6773a5e15958759adb623692c</id>
<content type='text'>
Reviewed by:	marcel
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:	marcel
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for some block functions that come from OS X.  These are</title>
<updated>2014-04-02T16:07:48+00:00</updated>
<author>
<name>David Chisnall</name>
<email>theraven@FreeBSD.org</email>
</author>
<published>2014-04-02T16:07:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=46cdc14062f7b52d86bd3791220019ebc8c9c120'/>
<id>46cdc14062f7b52d86bd3791220019ebc8c9c120</id>
<content type='text'>
intended to build with any C compiler.

Reviewed by:	pfg
MFC after:	3 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
intended to build with any C compiler.

Reviewed by:	pfg
MFC after:	3 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not force to run atexit handlers, which text comes from a dso</title>
<updated>2013-12-06T21:26:57+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2013-12-06T21:26:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a7afea438206b99a9676ba3139d07e896b9dd6f2'/>
<id>a7afea438206b99a9676ba3139d07e896b9dd6f2</id>
<content type='text'>
owning the handle passed to __cxa_finalize() but which are registered
by other dso, when the process is inside exit(3).

Running them makes the destruction order wrong, and there is hope that
such destructors would not call dlclose(3), since it is pointless at
this stage of the process existence.

The change effectively disables the r211706 after the exit(3) is
called.

Reported and tested by:	Michael Gmelin &lt;freebsd@grem.de&gt;
Analyzed by:	dim
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
owning the handle passed to __cxa_finalize() but which are registered
by other dso, when the process is inside exit(3).

Running them makes the destruction order wrong, and there is hope that
such destructors would not call dlclose(3), since it is pointless at
this stage of the process existence.

The change effectively disables the r211706 after the exit(3) is
called.

Reported and tested by:	Michael Gmelin &lt;freebsd@grem.de&gt;
Analyzed by:	dim
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>Renumber clauses to reduce diffs to other versions</title>
<updated>2013-05-28T20:57:40+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2013-05-28T20:57:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3fb3b97c4d38990da5f45b37e48a5110b3e9bc58'/>
<id>3fb3b97c4d38990da5f45b37e48a5110b3e9bc58</id>
<content type='text'>
NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info.</title>
<updated>2010-08-27T19:57:17+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2010-08-27T19:57:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3eaca8526c379d09c13e9a30f45cd7ea6ce886f1'/>
<id>3eaca8526c379d09c13e9a30f45cd7ea6ce886f1</id>
<content type='text'>
Reported and tested by:	Fabian Keil &lt;freebsd-listen fabiankeil de&gt;
MFC after:	17 days
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported and tested by:	Fabian Keil &lt;freebsd-listen fabiankeil de&gt;
MFC after:	17 days
</pre>
</div>
</content>
</entry>
</feed>
