History log of /freebsd-10.3-release/libexec/rtld-elf/libmap.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 296373 04-Mar-2016 marius

- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.3.
- Update default pkg(8) configuration to use the quarterly branch.

Approved by: re (implicit)

# 270756 28-Aug-2014 pfg

MFC r270256:
Always check the limits of array index variables before using them.

Obtained from: DragonFlyBSD


# 266640 25-May-2014 kib

MFC r266411:
Fix LD_LIBMAP.


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 255765 21-Sep-2013 des

Make the directory mapping functionality, which was previously only
available in 32-bit compatibility mode, unconditional.

Overhaul the man page, which had evolved more by accretion than by design.

Approved by: re (gjb)
MFC after: 3 weeks


# 242587 04-Nov-2012 jilles

rtld: Fix fd leak with parallel dlopen and fork/exec.

Rtld did not set FD_CLOEXEC on its internal file descriptors; therefore,
such a file descriptor may be passed to a process created by another thread
running in parallel to dlopen() or fdlopen().

No other threads are expected to be running during parsing of the hints
and libmap files but the file descriptors need not be passed to child
processes so add O_CLOEXEC there as well.

This change will break fdlopen() (as used by OpenPAM) on kernels without
F_DUPFD_CLOEXEC (added in July). Note that running new userland on old
kernels is not supported.

Reviewed by: kib


# 235059 05-May-2012 bapt

open the resolved path
fix debug message

Submitted by: John Marino <draco@marino.st>
Approved by: des (mentor)


# 234851 30-Apr-2012 bapt

Add two special directives to libmap.conf:
include <file>:
Parse the contents of file before continuing with the current file.
includedir <dir>:
Parse the contents of every file in dir that ends in .conf before continuing
with the current file.
Any file or directory encountered while processing include or includedir
directives will be parsed exactly once, even if it is encountered multiple
times.

Reviewed by: kib, des
Approved by: des (mentor)
MFC after: 1 month


# 232974 14-Mar-2012 kib

Rtld on diet 3.

Stop using strerror(3) in rtld, which brings in msgcat and stdio.
Directly access sys_errlist array of errno messages with private
rtld_strerror() function.

Now,
$ size /libexec/ld-elf.so.1
text data bss dec hex filename
96983 2480 8744 108207 1a6af /libexec/ld-elf.so.1

Reviewed by: dim, kan
MFC after: 2 weeks


# 232862 12-Mar-2012 kib

Rtld on diet part 2:

Do not use stdio for libmap.conf read. Directly map the file and
parse lines from the mappings.

Reviewed by: kan
MFC after: 3 weeks


# 232590 06-Mar-2012 pluknet

Cosmetic nit:
- rename isspace1() macro to the more appropriate rtld_isspace().

Discussed with: kib


# 232572 05-Mar-2012 kib

The libmap.conf initialization is performed before TLS is functional.
Since after r232498 the ctype macros require working access to
thread-local variables, rtld crashes when libmap.conf is present.

Use hand-made isspace1() macro which is enough to detect spaces in
libmap.conf.

Reported by: alc, lme, many on current@
Tested by: lme
Reviewed by: dim, kan
MFC after: 1 week


# 155084 31-Jan-2006 peter

Fix a malloc overrun in 32-bit compat libmap lookup code.


# 141232 04-Feb-2005 mdodd

Description from Dan:

Another handy libmap patch. Lets you do stuff like this:

LD_LIBMAP="libpthread.so.1=libthr.so.1" mythreadedapp

If you already have a program-specific override in libmap.conf, note
that you must use a program-specific override in LD_LIBMAP:

LD_LIBMAP="[mythreadedapp],libpthread.so.1=libthr.so.1" mythreadedapp

PR: bin/74471
Submitted by: Dan Nelson <dnelson AT allantgroup.com>
MFC after: 2 weeks


# 141230 04-Feb-2005 mdodd

style(9)


# 129638 24-May-2004 mdodd

Support basename and path based constrained matches.

eg:
[foo]
...

matches any executable 'foo'

[/usr/bin/foo/]
...

matches any executable under the directory /usr/bin/foo/

Exact matches continue to function as before.

PR: bin/66769
Submitted-by: Dan Nelson


# 127250 21-Mar-2004 peter

Add initial support for compiling a special 32 bit version of
ld-elf.so.1 on 64 bit systems. Most of this involves using alternate
paths, environment variables and diagnostic messages.

The build glue is seperate.


# 125397 03-Feb-2004 fjoe

Fix "warning: value computed is not used".

Found by: gcc 2.95.4 [FreeBSD]


# 120038 13-Sep-2003 mdodd

Change libmap.c:lm_init() to return a status value; 0 for success
(libmap available) and 1 for failure. Assign this return to the
global 'libmap_disable' variable in rtld.c.

This totally prevents any libmap functions from being called after
lm_init() if no config file is present.


# 116513 18-Jun-2003 mdodd

Include libmap.h for prototypes.


# 115445 31-May-2003 mdodd

Provide function entry debugging messages.


# 115400 30-May-2003 mdodd

Don't post-increment pointers inside a loop conditional.

While I'm here:
- Let lm_add() call strdup() on its own behalf.
- Use a temporary pointer when parsing constraints; only set the
constraint pointer on a totally successful match.

PR: bin/52783
Submitted by: David P. Reese Jr. <daver@gomerbud.com>
Approved by: re (rwatson)


# 115396 29-May-2003 kan

Allow threading libraries to register their own locking
implementation in case default one provided by rtld is
not suitable.

Consolidate various identical MD lock implementation into
a single file using appropriate machine/atomic.h.

Approved by: re (scottl)


# 115150 19-May-2003 mdodd

- Use xmalloc() and xstrdup() instead of malloc() and strdup().
- Add a global mapping if we have a successful constrained match.

Approved by: re


# 114316 30-Apr-2003 kan

Remove redundant strlen checks, do not check the same
symbol twice.


# 113312 10-Apr-2003 mdodd

Code cleanups and sanity checking for config file parser.


# 113229 07-Apr-2003 mdodd

Dynamic object dependency mapping: libmap.

This is an optional feature, disabled by default.

This will be useful to people testing the various POSIX threading
libraries under -CURRENT but can easily serve other needs.