870 Commits

Author SHA1 Message Date
Rich Felker
6ab444d97a load vdso, if present, into the dso list 2011-07-24 00:54:55 -04:00
Rich Felker
f7adc39e37 const correctness on function pointer 2011-07-24 00:54:36 -04:00
Rich Felker
a53de812d2 simplify dynamic linker startup
instead of creating temp dso objects on the stack and moving them to
the heap if dlopen/dlsym are used, use static objects to begin with,
and just donate them to malloc if we no longer need them.
2011-07-24 00:26:12 -04:00
Rich Felker
e3eb49321c some preliminaries for vdso clock support
these changes also make it so clock_gettime(CLOCK_REALTIME, &ts) works
even on pre-2.6 kernels, emulated via the gettimeofday syscall. there
is no cost for the fallback check, as it falls under the error case
that already must be checked for storing the error code in errno, but
which would normally be hidden inside __syscall_ret.
2011-07-23 23:45:33 -04:00
Rich Felker
c0fe5b9da9 check for fd exhaustion in forkpty
we cannot report failure after forking, so the idea is to ensure prior
to fork that fd 0,1,2 exist. this will prevent dup2 from possibly
hitting a resource limit and failing in the child process. fcntl
rather than dup2 is used prior to forking to avoid race conditions.
2011-07-22 00:25:56 -04:00
Rich Felker
d40e344f7b incorrect check for open failure in openpty function
-1, not 0, indicates failure
2011-07-22 00:23:36 -04:00
Rich Felker
63d447e2a3 socket headers macro adjustment - workaround for buggy programs
some program was undefining AF_NETLINK and thereby breaking AF_ROUTE...
2011-07-21 22:44:05 -04:00
Rich Felker
fa845669ce fix errno value when fdopendir is given an invalid file descriptor
this resolves an issue reported by Vasiliy Kulikov
2011-07-21 21:15:14 -04:00
Rich Felker
4ec07e1f60 ensure in fork that child gets its own new robust mutex list 2011-07-16 23:17:17 -04:00
Rich Felker
94a0171d80 fix logic error in fread
fread was calling f->read without checking that the file was in
reading mode. this could:
1. crash, if f->read was a null pointer
2. cause unwanted blocking on a terminal already at eof
3. allow reading on a write-only file
2011-07-16 21:24:02 -04:00
Rich Felker
47d027ee1a fix various bugs in new integer parser framework
1. my interpretation of subject sequence definition was wrong. adjust
parser to conform to the standard.

2. some code for handling tail overflow case was missing (forgot to
finish writing it).

3. typo (= instead of ==) caused ERANGE to wrongly behave like EINVAL
2011-07-14 22:11:00 -04:00
Rich Felker
d3fd192523 fix wcsto[iu]max with high characters
stopping without letting the parser see a stop character prevented
getting a result. so treat all high chars as the null character and
pass them into the parser.

also eliminated ugly tmp var using compound literals.
2011-07-14 01:12:05 -04:00
Rich Felker
ecc9c5fcfa new restartable integer parsing framework.
this fixes a number of bugs in integer parsing due to lazy haphazard
wrapping, as well as some misinterpretations of the standard. the new
parser is able to work character-at-a-time or on whole strings, making
it easy to support the wide functions without unbounded space for
conversion. it will also be possible to update scanf to use the new
parser.
2011-07-14 00:51:45 -04:00
Rich Felker
0e2331c9b6 gb18030 support in iconv (only from, not to)
also support (and restrict to subsets) older chinese sets, and
explicitly refuse to convert to cjk (since there's no code for it yet)
2011-07-12 20:30:04 -04:00
Rich Felker
c3c5e88c31 "implement" getnetbyaddr and getnetbyname
these are useless legacy functions but some old software contains
cruft that expects them to exist...
2011-07-12 02:52:06 -04:00
Rich Felker
95a85e047e legacy japanese charset support in iconv (only from, not to) 2011-07-12 02:43:24 -04:00
Rich Felker
594b16e004 simplify iconv and support more legacy codepages 2011-07-12 00:31:39 -04:00
Rich Felker
6b1d3817cf add missing signalfd flags 2011-07-09 18:06:59 -04:00
Rich Felker
a9e6d01114 printf: "if a precision is specified, the '0' flag shall be ignored." 2011-07-04 11:55:52 -04:00
Rich Felker
cc44d9f201 zero precision with zero value should not inhibit prefix/width printing 2011-07-04 01:57:00 -04:00
Rich Felker
3d54adbe47 printf("%#x",0) should print 0 not 0x0 2011-07-04 01:01:58 -04:00
Rich Felker
2f0c415ceb iconv was not returning -1 on most failure
this broke most uses of iconv in real-world programs, especially
glib's iconv wrappers.
2011-07-03 19:26:12 -04:00
Rich Felker
58483f0afd 0.7.12 release notes v0.7.12 2011-07-03 16:41:20 -04:00
Rich Felker
2fdea17c3d fix dlopen UB due to longjmp/volatile rules violation 2011-07-01 22:40:00 -04:00
Rich Felker
e936e4612f res_search symbol, aliased to res_query for now (better than nothing) 2011-06-30 23:12:07 -04:00
Rich Felker
191ebcac31 simple rpath support (no token expansion yet) for dynamic linker 2011-06-30 23:02:27 -04:00
Rich Felker
17be829104 fill in junk in stropts.h
STREAMS are utterly useless as far as I can tell, but some software
was apparently broken by the presence of stropts.h but lack of macros
it's supposed to define...
2011-06-30 20:23:24 -04:00
Rich Felker
daaef3552d fix error in previous ld80 fpclassify commit 2011-06-30 16:37:51 -04:00
Rich Felker
f6fd351c70 catch invalid ld80 bit patterns and treat them as nan
this should not be necessary - the invalid bit patterns cannot be
created except through type punning. however, some broken gnu software
is passing them to printf and triggering dangerous stack-smashing, so
let's catch them anyway...
2011-06-30 16:31:43 -04:00
Rich Felker
e5cb55fedd fix logic in __fwriting 2011-06-30 13:27:08 -04:00
Rich Felker
a0b56b947a add and consolidate nasty stdio_ext junk
hopefully this resolves the rest of the issues with hideously
nonportable hacks in programs that use gnulib.
2011-06-30 12:44:48 -04:00
Rich Felker
7640497f5f implement the nonstandard GNU function fpurge
this is a really ugly and backwards function, but its presence will
prevent lots of broken gnulib software from trying to define its own
version of fpurge and thereby failing to build or worse.
2011-06-30 11:42:33 -04:00
Rich Felker
fb62ae74d0 fix buffer overrun in getgrent code when there are no group members 2011-06-30 08:11:06 -04:00
Rich Felker
f9ed11f3e1 posix_memalign should fail if size is not a multiple of sizeof(void *) 2011-06-29 19:26:30 -04:00
Rich Felker
47e72e10d5 avoid errors in ucontext.h when no feature test macros are defined 2011-06-29 17:13:01 -04:00
Rich Felker
f7dff1852b locking support for random() prng
these interfaces are required to be thread-safe even though they are
not state-free. the random number sequence is shared across all
threads.
2011-06-29 15:29:52 -04:00
Rich Felker
af3d5405b8 work around linux bug in mprotect
per POSIX: The mprotect() function shall change the access protections
to be that specified by prot for those whole pages containing any part
of the address space of the process starting at address addr and
continuing for len bytes.

on the other hand, linux mprotect fails with EINVAL if the base
address and/or length is not page-aligned, so we have to align them
before making the syscall.
2011-06-29 00:42:42 -04:00
Rich Felker
9f17413c75 textrel support, cheap and ugly 2011-06-29 00:29:08 -04:00
Rich Felker
2cee45762a release notes for 0.7.11 v0.7.11 2011-06-28 22:06:58 -04:00
Rich Felker
6717e62ac0 reclaim the memory wasted by dynamic linking for use by malloc 2011-06-28 19:40:14 -04:00
Rich Felker
e411827960 use type directives for fenv asm functions 2011-06-28 14:41:41 -04:00
Rich Felker
bf30100ad7 use load address from elf header if possible
this is mostly useless for shared libs (though it could help for
prelink-like purposes); the intended use case is for adding support
for calling the dynamic linker directly to run a program, as in:
./libc.so ./a.out foo

this usage is not yet supported.
2011-06-28 14:20:41 -04:00
Rich Felker
c7debe13ee make dynamic linker relocate the main program image last, after all libs
prior to this change, copy relocations for initialized pointer
variables would not reflect the relocated contents of the pointer.
2011-06-28 14:13:51 -04:00
Rich Felker
8d54681f15 fix a few bugs from last dynamic linking build system commit
some cruft was left and DESTDIR was not being used correctly.
2011-06-28 08:27:38 -04:00
Rich Felker
f9c9d8c333 minor updates to INSTALL documentation 2011-06-27 22:34:47 -04:00
Rich Felker
207c45d7ab cleanup shared library build system to be more $HOME-local-install friendly
the path for the dynamic linker is now configurable, and failure to
install the symlink for it will not stop the build.
2011-06-27 21:38:11 -04:00
Rich Felker
230f1813ad further fixup dlfcn.h 2011-06-27 01:02:28 -04:00
Rich Felker
87a30ce50d match LSB/glibc constants for dynamic loader 2011-06-27 01:01:19 -04:00
Rich Felker
9e17b71fa6 fix stale pointer issue in dynamic linker with dlopen 2011-06-26 22:39:34 -04:00
Rich Felker
06933cc724 don't leave the lock held on dlopen failure.. 2011-06-26 22:09:32 -04:00