Commit Graph

2608 Commits

Author SHA1 Message Date
joerg d5a77cf108 Fix merge error that broke HPPA 2011-03-26 21:40:37 +00:00
joerg cb1cd7e860 Add basic locking to ld.elf_so. 2011-03-25 18:07:04 +00:00
bouyer d9210c2405 Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
2011-03-24 17:05:39 +00:00
skrll 83c1874f74 Another TLS reloc. Thanks to joerg for a hint. 2011-03-17 22:07:52 +00:00
matt 7e7a53defe Add support for the MIPS TLS reloc types in shared libraries. 2011-03-15 07:40:52 +00:00
skrll be1a58855d More PLABELS are required due to TLS stuff. 2011-03-14 08:49:29 +00:00
skrll d3aab036e1 Handle some TLS relocs. 2011-03-14 08:21:54 +00:00
skrll 92c298c3a1 First cut at mdtls.c for hppa. 2011-03-14 08:20:15 +00:00
joerg e7a5551d99 Fill in TLS related fields in dl_iterate_phdr if TLS is supported 2011-03-13 21:08:45 +00:00
joerg 854e6cd69f Add TLS support for AMD64, i386 and SH3.
This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-12 22:54:36 +00:00
bouyer 72918bae56 Define qfextension here 2011-03-12 12:30:39 +00:00
matt 130f2d3d4c Add TLS support for PowerPC.
If the port has __lwp_gettcb_fast or __lwp_settcb use them instead of
__lwp_getprivate_fast or lwp_setprivate.
2011-03-12 07:43:53 +00:00
joerg 7197db08bd Add some clarifications 2011-03-10 17:38:30 +00:00
joerg 9c18c3d543 Add source reference for _lwp_makecontext and
__HAVE___LWP_GETPRIVATE_FAST. Fix enumeration.
2011-03-10 17:22:17 +00:00
reed 728c26c193 A filename with a colon in it made it appear to be the URI scheme
to various web browsers. So follow RFC 3986 4.2 and prepend ./
to the filename in the generated index hyperlink.

Okayed by mrg.
2011-03-10 14:39:40 +00:00
reed 92d8a7ba74 Fix typo. 2011-03-10 14:37:16 +00:00
joerg de4cf97515 Fix prototype for __tls_get_addr. Add a generic implementation of it
using __tls_get_addr. Update TLS notes.
2011-03-10 14:27:31 +00:00
skrll ff1072d23a Whitespace. 2011-03-10 12:53:42 +00:00
joerg aad599979d 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.
2011-03-09 23:10:05 +00:00
bouyer 063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
matt 4fee4fe7b3 Don't rely on >32bit math. 2011-03-04 00:40:48 +00:00
pooka 33ee52c7dc make DEBUG compile without RTLD_DEBUG 2011-02-24 10:58:54 +00:00
matt 483a1c95a2 Fix problem with bss-plt objects which a reloc index, not offset.
(secure-plt uses an offset (index*sizeof(rela), bss-plt uses an index)
secure-plt will now take the offset and divide by 12 for an index.
2011-02-10 02:28:20 +00:00
pooka eb725c2168 Call daemon() later to make sure there is a listening socket by
the time the foreground process exits.

discussed with mrg.
2011-02-06 19:00:53 +00:00
skrll 3770380428 Unbreak gdb by ensuring _rtld_debug_state is in the dynamic symbol table.
mmm 1 line diffs

mmm not breaking backwards compatibility for anything known/unknown or
public/private.
2011-01-25 12:25:43 +00:00
matt 709c8a2f01 Move powerpc gotptr to the end to preserve binary compatibility. 2011-01-16 15:56:37 +00:00
matt b094d98191 Warn about DT_TEXTRELs 2011-01-16 02:36:05 +00:00
matt d31dbd7578 Add secure-plt support for powerpc to ld.elf_so. As part of this, we have to
stop calling into the GOT/_DYNAMIC since they are no longer executable.
2011-01-16 01:22:29 +00:00
christos bfd4da8575 PR/44390: Paul Koning: make code gcc-4.5.1 friendly. 2011-01-14 23:56:13 +00:00
pooka 09159e5c0a Make sure bozo_auth_check_401() isn't called with a NULL "request".
reviewed by mrg
2011-01-12 19:29:24 +00:00
plunky f302f6417c the Name for this manpage is "ld.aout_so". Use it. 2011-01-01 16:34:52 +00:00
skrll f1d73a2c94 Add support for DF_1_BIND_NOW, DF_1_NODELETE and DF_1_NOOPEN marked
objects, and the RTLD_NODELETE and RTLD_NOLOAD flags to dlopen(3).

Mark libpthread as DF_1_NOOPEN and use it to test the functionality.

Somewhat taken from FreeBSD.

Fixes PR 42029.

OK from christos and joerg.
2010-12-24 12:41:42 +00:00
mlelstv e5275d16e0 Deduce raw device correctly by prepending "r" to basename. 2010-12-23 18:08:41 +00:00
skrll 1f45aab781 Sprinkle some KNF. 2010-12-19 17:26:51 +00:00
skrll ad7786ec8b Remove unnecessary #ifdef RTLD_DEBUG 2010-12-19 17:17:50 +00:00
wiz 617acddc41 Remove superfluous Pp. 2010-12-17 08:50:26 +00:00
skrll 1ee8ff33ba Remove implementation detail.
Bump date.
2010-12-17 07:04:52 +00:00
joerg c4120e324e Replace use of errlist with a single concatenated version and an offset
array. This requires less storage and avoids one runtime relocation per
errno value.
2010-12-16 22:52:32 +00:00
joerg 67cc8c0871 Don't use normal environment handling functions from libc, but iterate
once over the array and clean out entries as needed.
2010-12-16 22:47:27 +00:00
skrll 126c589398 s/rdbg/dbg/ in a few places. 2010-12-16 19:59:39 +00:00
skrll 76d5f138f4 Remove incorrect comment. 2010-12-16 19:35:38 +00:00
wiz fbc697a1ed Note that $ORIGIN kernel support (in kern/kern_exec.c) is currently disabled.
Info from skrll@.
Bump date.
2010-12-16 19:25:41 +00:00
tls eaa351b215 When invoking a content handler specified via -C, set the REDIRECT_STATUS
CGI variable to "200".  This approximates the Apache behavior which is
required by phpcgi in PHP 5.3 (and by some compilations of older PHP
versions).

I have a revolutionary idea.  Perhaps instead of imposing bizarre
requirements on other programs in the name of "security", the PHP
developers should make their own code compile with oh, I don't know,
maybe -Wuninitialized.  That might have an effect on the security of
systems using PHP rather than on the "security" of such systems...

...excuse me, got to go now, I think my airquotes just wore out.
2010-12-14 13:27:39 +00:00
joerg 67e01e0a99 Build ld.elf_so with -fvisibility=hidden. Exploit this for i386/x86_64
to simplify the assembler code.
2010-12-05 00:56:06 +00:00
joerg 91118529e4 ANSIfy 2010-12-03 23:07:49 +00:00
joerg 239c31f883 Add comment about the unusual stack alignment in .rtld_bind_start. 2010-12-03 22:48:25 +00:00
tron 1fbd900608 Don't use internal libc function __findenv(). 2010-11-14 22:09:16 +00:00
christos acfd35dad9 PR/44010: YAMAMOTO Takashi: sbrk: grow 0xb3ba2000 failed, error = 12"
(due to setenv changes?)
Provide a mini unsetenv that does not allocate/free memory and does not
bother about locking.
2010-10-29 15:08:17 +00:00
skrll 8b916d603d Add cast so that usr.bin/ldd/elf32 builds. 2010-10-16 17:48:12 +00:00
skrll e6cdac9c4b Implement dl_iterate_phdr.
Somewhat taken from FreeBSD. Manual page from OpenBSD.
2010-10-16 10:27:06 +00:00