OpenBSD CVS

CVS log for src/libexec/ld.so/util.h


[BACK] Up to [local] / src / libexec / ld.so

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.41 / (download) - annotate - [select for diffs], Fri May 17 06:11:54 2024 UTC (3 weeks, 1 day ago) by deraadt
Branch: MAIN
CVS Tags: HEAD
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored)

use SIGKILL instead of 9; ok guenther

Revision 1.40 / (download) - annotate - [select for diffs], Fri Dec 8 12:58:27 2023 UTC (6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.39: +3 -1 lines
Diff to previous 1.39 (colored)

locally us MAXIMUM() rather than MAX()
ok tb gnezdo

Revision 1.39 / (download) - annotate - [select for diffs], Tue Aug 15 06:26:34 2023 UTC (9 months, 3 weeks ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

Improve handling of dlopen(RTLD_TRACE) aka ldd, of a library that
is already loaded:
 * add a 'trace' argument to _dl_show_objects() and exit the
   walk-the-objects loop if you hit that traced object
 * in dlopen(), pass the trace object to _dl_show_objects()
 * also, invoke _dl_show_objects() + exit if the object was
   already opened
 * pass NULL to _dl_show_objects() for all the other calls
 * oh hey, _dl_tracelib is now superfluous: _dl_show_objects()
   should do the walk-the-objects loop only if trace is not NULL.

Problem noted by gnezdo@
ok millert@

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jan 29 20:30:21 2023 UTC (16 months, 1 week ago) by gnezdo
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.37: +3 -1 lines
Diff to previous 1.37 (colored)

Unite all nitems copies in ld.so/util.h

OK deraadt

Revision 1.37 / (download) - annotate - [select for diffs], Sat Jan 8 06:49:41 2022 UTC (2 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored)

Prep .c files for removing the #includes from */archdep.h
 * replace #include "archdep.h" with #includes of what is used, pulling in
   "syscall.h", "util.h", and "archdep.h" as needed
 * delete #include <sys/syscall.h> from syscall.h
 * only pull in <sys/stat.h> to the three files that use _dl_fstat(),
   forward declare struct stat in syscall.h for the others
 * NBBY is for <sys/select.h> macros; just use '8' in dl_printf.c
 * <machine/vmparam.h> is only needed on i386; conditionalize it
 * stop using __LDPGSZ: use _MAX_PAGE_SHIFT (already used by malloc.c)
   where necessary
 * delete other bogus #includes, order legit per style: <sys/*> then
   <*/*>, then <*>, then "*"

dir.c improvement from jsg@
ok and testing assistance deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Sun Jul 14 03:23:12 2019 UTC (4 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

ld.so's $ORIGIN handling when argv[0] is a relative path was broken by
the change in __getcwd(2)'s return value.  Fix it by switching to the
__realpath(2) syscall, eliminating the ld.so copy of realpath().

problem caught by regress and noted by bluhm@
ok deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Fri May 10 13:29:21 2019 UTC (5 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.34: +12 -2 lines
Diff to previous 1.34 (colored)

ld.so boot cleanup support:
 - put functions and data which are only used before calling the executable's
   start function into their own page-aligned segments for unmapping
   (only done on amd64, arm64, armv7, powerpc, and sparc64 so far)
 - pass .init_array and .preinit_array functions an addition argument which
   is a callback to get a structure which includes a function that frees
   the boot text and data
 - sometimes delay doing RELRO processing: for a shared-object marked
   DF_1_INITFIRST do it after the object's .init_array, for the executable
   do it after the .preinit_array
 - improve test-ld.so to link against libpthread and trigger its initialization
   late
libc changes to use this will come later

ok kettenis@

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jan 25 00:19:26 2019 UTC (5 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

I am retiring my old email address;  replace it with my OpenBSD one.

Revision 1.33 / (download) - annotate - [select for diffs], Tue Oct 23 04:01:45 2018 UTC (5 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.32: +2 -1 lines
Diff to previous 1.32 (colored)

Delay processing of ld.so's own PT_GNU_RELRO section until after environment
processing and malloc initialization, and then move variables set by those
steps, including malloc's mopts structure, into the .data.rel.ro segment.
This protects more data and eliminates the extra padding of the mopts.

ok kettenis@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Dec 1 23:30:05 2017 UTC (6 years, 6 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

Redo the calculation of the alignment and placement of static TLS data to
correctly take into account the segment p_align.  Previously, anything
with a size belong the natural alignment or with alignment larger than
the natural one would either not be intialized correctly, be misaligned,
or result in the TIB being misaligned.

Problems reported by Charles Collicutt (charles (at) collicutt.co.uk)
ok kettenis@

Revision 1.31 / (download) - annotate - [select for diffs], Tue Aug 29 15:25:51 2017 UTC (6 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

rename *fdprint function to *dprintf, like libc version

Revision 1.30 / (download) - annotate - [select for diffs], Tue Jan 24 07:48:37 2017 UTC (7 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.29: +5 -12 lines
Diff to previous 1.29 (colored)

On fatal errors, kill ourselves with thrkill(0,9,NULL) instead of
simply exiting, via helper functions _dl_die(), _dl_diedie(), and
_dl_oom().

prompted by a complaint from jsing@
ok jsing@ deraadt@

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jan 23 11:04:19 2017 UTC (7 years, 4 months ago) by guenther
Branch: MAIN
Changes since 1.28: +3 -1 lines
Diff to previous 1.28 (colored)

Wrap function declarations with __{BEGIN,END}_HIDDEN_DECLS to reduce
relocations inside ld.so that it has to bootstrap

ok kettenis@

Revision 1.28 / (download) - annotate - [select for diffs], Sat Aug 27 03:52:25 2016 UTC (7 years, 9 months ago) by guenther
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Pull in <stddef.h> for NULL
(not stdio, because ld.so has a reduced library behind it)

Revision 1.27 / (download) - annotate - [select for diffs], Fri Aug 12 20:39:01 2016 UTC (7 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

the slimmed down random functions inside ld.so are strict clones of the
libc arc4random API, so call them _dl_{arc4random,arcrandombuf}
ok tedu guenther

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jun 21 08:00:23 2014 UTC (9 years, 11 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.25: +5 -2 lines
Diff to previous 1.25 (colored)

Move to a non-zeroing _dl_malloc, a _dl_calloc and _dl_reallocarry and
fix _dl_strdup to return NULL instead of crash; ok deraadt@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jan 23 01:07:45 2014 UTC (10 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

improve some types

Revision 1.24 / (download) - annotate - [select for diffs], Wed Nov 27 21:25:04 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

make the _dl_isalnum() resemble the ctype version
prodding from kettenis

Revision 1.23 / (download) - annotate - [select for diffs], Fri Apr 5 12:58:03 2013 UTC (11 years, 2 months ago) by kurt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.22: +13 -11 lines
Diff to previous 1.22 (colored)

- Add ORIGIN, OSNAME, OSREL and PLATFORM substitution support for rpaths.
Improvements and okay matthew@, millert@, guenther@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Aug 7 17:47:06 2012 UTC (11 years, 10 months ago) by matthew
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.21: +2 -1 lines
Diff to previous 1.21 (colored)

Factor out a _dl_randombuf() method from _dl_random().

Revision 1.21 / (download) - annotate - [select for diffs], Mon May 18 20:20:01 2009 UTC (15 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.20: +7 -5 lines
Diff to previous 1.20 (colored)

make _dl_wrstderr() not call write per-character; ok drahn

Revision 1.20 / (download) - annotate - [select for diffs], Fri Feb 9 14:51:13 2007 UTC (17 years, 4 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored)

readdir buffers should not get a fixed buffer size, but should be dependant
on the block size of the filesystem. Rounded up to page size for efficiency.
similar to change in libc yesterday. Should fix PR 5364.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Oct 17 03:56:49 2004 UTC (19 years, 7 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.18: +14 -1 lines
Diff to previous 1.18 (colored)

Fix some problems related to LD_LIBRARY_PATH parsing where it would not
correctly deal with current directory searches specified by "::", ":foo" or
"foo:"

Revision 1.18 / (download) - annotate - [select for diffs], Tue May 25 21:42:47 2004 UTC (20 years ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.17: +12 -3 lines
Diff to previous 1.17 (colored)

provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok

Revision 1.17 / (download) - annotate - [select for diffs], Tue Nov 11 14:51:01 2003 UTC (20 years, 7 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.16: +19 -1 lines
Diff to previous 1.16 (colored)

Better fix to the library name parsing. now correctly handles
libpython2.2.so.0.0 vs libpython2.1.so.0.0. Clean up a potential
memory leak if the filename is not a valid library.
ok brad@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jul 6 20:03:58 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.15: +10 -1 lines
Diff to previous 1.15 (colored)

various proto, ansi, and knf repair.  tested on all architectures that
use it. (build may require make cleandir because of .depend balony)

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jun 11 17:47:57 2003 UTC (21 years ago) by deraadt
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

no more register

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jun 9 16:10:03 2003 UTC (21 years ago) by deraadt
Branch: MAIN
Changes since 1.13: +1 -7 lines
Diff to previous 1.13 (colored)

pefo 3/4 licence cleanups

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 30 01:13:53 2003 UTC (21 years ago) by drahn
Branch: MAIN
Changes since 1.12: +2 -1 lines
Diff to previous 1.12 (colored)

When loading a shared object or libraries dependant object, load them
in random order. This will reduce the possiblity of a buffer overflow
being able to predict the addresss of useful code. Can be disabled
with the LD_NORANDOM environment variable for debugging purposes.
ok deraadt.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Aug 31 15:11:59 2002 UTC (21 years, 9 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.11: +2 -1 lines
Diff to previous 1.11 (colored)

argh, include prototype for dl_fdprintf(), missed by myself and reviewers.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jul 24 04:11:21 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +35 -30 lines
Diff to previous 1.10 (colored)

use real clones of the libc functions

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jul 24 04:11:10 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.9: +8 -9 lines
Diff to previous 1.9 (colored)

ok i found it

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jul 24 04:00:44 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +9 -8 lines
Diff to previous 1.8 (colored)

back out broken stuff until it is fixed

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jul 24 00:13:55 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +8 -8 lines
Diff to previous 1.7 (colored)

make more _dl_*() func params like real ones in libc

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jul 23 23:56:31 2002 UTC (21 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.6: +1 -2 lines
Diff to previous 1.6 (colored)

match _dl_ syscall prototypes w/ the real syscalls prototypes, including args and return values; art@ ok

Revision 1.6 / (download) - annotate - [select for diffs], Tue May 28 00:23:57 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

proto _dl_show_objects() in one place

Revision 1.5 / (download) - annotate - [select for diffs], Mon May 27 20:07:06 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

left over __P removals

Revision 1.4 / (download) - annotate - [select for diffs], Fri May 24 18:37:38 2002 UTC (22 years ago) by drahn
Branch: MAIN
Changes since 1.3: +25 -7 lines
Diff to previous 1.3 (colored)

Change _dl_strcpy() to _dl_strlcpy(), implementation taken from libc.

Revision 1.3 / (download) - annotate - [select for diffs], Fri May 24 03:44:37 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.2: +15 -17 lines
Diff to previous 1.2 (colored)

various KNF

Revision 1.2 / (download) - annotate - [select for diffs], Tue Apr 9 19:59:47 2002 UTC (22 years, 2 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.1: +34 -0 lines
Diff to previous 1.1 (colored)

Add the Copyrights from the respective files the code came from. ok deraadt@

Revision 1.1 / (download) - annotate - [select for diffs], Thu Feb 21 23:17:53 2002 UTC (22 years, 3 months ago) by drahn
Branch: MAIN

cleanup of MD/MI ld.so (elf), most changes by art@ cleanup by me.
tested on alpha sparc64 powerpc.

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.