The NetBSD Project

CVS log for src/lib/libc/misc/initfini.c

[BACK] Up to [cvs.NetBSD.org] / src / lib / libc / misc

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.17 / (download) - annotate - [select for diffs], Sat Jan 20 14:52:48 2024 UTC (2 months, 3 weeks ago) by christos
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +3 -7 lines
Diff to previous 1.16 (colored) to selected 1.13 (colored)

Catch up with all the lint warnings since exit on warning was disabled.
Disable 'missing header declaration' and 'nested extern' warnings for now.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jul 18 11:44:32 2023 UTC (9 months ago) by riastradh
Branch: MAIN
Changes since 1.15: +2 -5 lines
Diff to previous 1.15 (colored) to selected 1.13 (colored)

libc: Use RB_TREE_INITIALIZER to nix initfini.c/_env.c coupling.

Doesn't actually help to remove _env.c from programs that don't use
it, though, because various internal things like __diagassert13 still
call getenv.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Apr 20 21:42:32 2021 UTC (2 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.14: +6 -3 lines
Diff to previous 1.14 (colored) to selected 1.13 (colored)

Instead of compiling files with -fcommon, create an include file and declare
the 3 symbols that need to be common using an attribute. Put all the 3 symbol
definitions in libc in one place (initfini.c). Reviewed by joerg@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 17 15:26:44 2017 UTC (6 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp
Changes since 1.13: +5 -3 lines
Diff to previous 1.13 (colored)

PR 51654: Don't initialize _dlauxinfo for static binaries.

Emacs likes save all memory of the main binary and the first run of
_libc_init via .init will get the wrong (old) value of __ps_strings.
By avoiding the initialization of _dlauxinfo for shared applications,
it will be touched only by the _libc_init call from crt0.o itself,
at which point __ps_strings is correct.

Revision 1.13 / (download) - annotate - [selected], Sat Nov 26 21:17:06 2016 UTC (7 years, 4 months ago) by dholland
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, netbsd-8-base, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.12: +16 -2 lines
Diff to previous 1.12 (colored)

More of previous.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Nov 26 20:38:20 2016 UTC (7 years, 4 months ago) by dholland
Branch: MAIN
Changes since 1.11: +8 -4 lines
Diff to previous 1.11 (colored) to selected 1.13 (colored)

fix comment about initialization-time calls; ok joerg

Revision 1.11 / (download) - annotate - [select for diffs], Mon Aug 19 22:14:37 2013 UTC (10 years, 8 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored) to selected 1.13 (colored)

Put the startup code in .text.startup

Revision 1.10 / (download) - annotate - [select for diffs], Thu Feb 16 23:00:39 2012 UTC (12 years, 2 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.9: +20 -4 lines
Diff to previous 1.9 (colored) to selected 1.13 (colored)

Add _dlauxinfo helper function to provide access to the ELF auxilary
vector. This can normally be found via __ps_strings, but libc is
initialised too early when linked dynamically and doesn't have access to
it yet, so provide an alternative mechanism via ld.elf_so.
Bump libc minor.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Mar 9 23:10:06 2011 UTC (13 years, 1 month ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, cherry-xenmp-base, cherry-xenmp
Branch point for: yamt-pagecache
Changes since 1.8: +12 -2 lines
Diff to previous 1.8 (colored) to selected 1.13 (colored)

Add TLS support infrastructure. For dynamic binaries, ld.elf_so exports
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.

Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Mar 7 05:09:11 2011 UTC (13 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.7: +28 -5 lines
Diff to previous 1.7 (colored) to selected 1.13 (colored)

Pass down ELF Auxillary Vectors for static NetBSD binaries too.
Rename __libc_init to _libc_init and call it explicitly from CSU code.
This enforces the constructor run order for newly linked programs.
Keep it as constructor with run-once semantic for binary compatibility.
Implement dl_iterate_phdr for statically linked programs.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Nov 14 18:11:42 2010 UTC (13 years, 5 months ago) by tron
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.6: +6 -2 lines
Diff to previous 1.6 (colored) to selected 1.13 (colored)

Improve and simplify implementation of *env(3) functions:
- Use RB tree to keep track of memory allocated via setenv(3) as
  suggested by Enami Tsugutomo in private e-mail.
  This simplifies the code a lot as we no longer need to keep the size
  of "environ" in sync with an array of allocated environment variables.
  It also makes it possible to free environment variables in unsetenv(3)
  if something has changed the order of the "environ" array.
- Fix a bug in getenv(3) and getenv_r(3) which would return bogus
  results e.g. for " getenv("A=B") " if an environment variable "A"
  with value "B=C" exists.
- Clean up the internal functions:
  - Don't expose the read/write lock for the environment to other parts
    of "libc". Provide locking functions instead.
  - Use "bool" to report success or failure.
  - Use "ssize_t" or "size_t" instead of "int" for indexes.
  - Provide internal functions with simpler interfaces e.g. don't
    combine return values and reference arguments.
  - Don't copy "environ" into an allocated block unless we really need
    to grow it.

Code reviewed by Joerg Sonnenberger and Christos Zoulas, tested by
Joerg Sonnenberger and me. These changes also fix problems in
zsh 4.3.* and pam_ssh according to Joerg.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jun 28 21:58:02 2010 UTC (13 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored) to selected 1.13 (colored)

Ensure that initfini.c is referenced by exit.c. The start up code has to
reference the latter as a return of main() results in a call to exit(3),
so this ensures that the libc constructors are run for statically linked
programs. Fixes PR 37454.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Apr 28 20:23:00 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, netbsd-5-base, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-premerge-20091211, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase, christos-time_t-nbase, christos-time_t-base
Branch point for: netbsd-5, matt-nb5-mips64, christos-time_t
Changes since 1.4: +2 -9 lines
Diff to previous 1.4 (colored) to selected 1.13 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.4 / (download) - annotate - [select for diffs], Mon Feb 25 14:06:13 2008 UTC (16 years, 1 month ago) by xtraeme
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, matt-armv6-nbase, keiichi-mipv6-base, hpcarm-cleanup-base
Branch point for: yamt-pf42
Changes since 1.3: +6 -2 lines
Diff to previous 1.3 (colored) to selected 1.13 (colored)

Make the atexit mutex recursive and initialize it in __libc_init()
as suggested by ad@, based on the patch provided by Sverre Froyen
in lib/37654.

Reviewed by ad@ and jmcneill@.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Feb 10 18:45:41 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Branch point for: keiichi-mipv6
Changes since 1.2: +6 -2 lines
Diff to previous 1.2 (colored) to selected 1.13 (colored)

Enable the atomic ops in userspace.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Nov 13 15:33:55 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base, cube-autoconf-base, cube-autoconf
Branch point for: matt-armv6
Changes since 1.1: +9 -1 lines
Diff to previous 1.1 (colored) to selected 1.13 (colored)

- Make it pass lint.
- Add RCSID.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Nov 13 15:21:20 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
Diff to selected 1.13 (colored)

- stack_protector.c doesn't really belong under sys/. Add a new directory
  for misc support routines and put it there.
- Add a libc constructor. Use this to initialize threading and the
  stack protector stuff. libpthread cannot be initialized safely using
  its own constructor because libc and libpthread are deeply intertwined.
  PR bin/37347

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>