summaryrefslogtreecommitdiffstats
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Fix double ;;kevlo2010-12-061-1/+1
|
* Catch up with kernel using time_uptime to drive ARP timeouts.glebius2010-12-061-3/+3
| | | | Noticed by: jilles
* Use -fPIC to build libexec/rtld-elf on sparc64, so it will also be abledim2010-11-111-1/+6
| | | | | | to link with newer binutils, without overflowing the GOT. Obtained from: projects/binutils-2.17
* Fix typos.brucec2010-11-091-1/+1
| | | | | PR: bin/148894 Submitted by: olgeni
* In r214728, if dlopen() is called for the object that has been alreadykib2010-11-041-5/+5
| | | | | | | | | | | | | | | | | loaded as a dependency and marked -z nodlopen, object' DAG is already initialized by load_needed_objects(). Due to this, the init_dag() call from dlopen() does not increment refcount for the object [1]. Change init_dag() to not increment DAG refcount. Require explicit calls to ref_dag() to increment, and assert that ref_dag() and unref_dag() are called for root that has dag initialized. To fix the noted issue, unconditionally call both init_dag() and ref_dag() in dlopen() for the case when the object was already loaded, making it similar to the case of newly loaded object. Noted by: jh [1] Reviewed by: jh, kan MFC after: 6 days
* Fix style.kib2010-11-041-1/+1
| | | | MFC after: 6 days
* If dlopen() is called for the dso that has been already loaded as akib2010-11-032-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dependency, then the dso never has its DAG initialized. Empty DAG makes ref_dag() call in dlopen() a nop, and the dso refcount is off by one. Initialize the DAG on the first dlopen() call, using a boolean flag to prevent double initialization. From the PR (edited): Assume we have a library liba.so, containing a function a(), and a library libb.so, containing function b(). liba.so needs functionality from libb.so, so liba.so links in libb.so. An application doesn't know about the relation between these libraries, but needs to call a() and b(). It dlopen()s liba.so and obtains a pointer to a(), then it dlopen()s libb.so and obtains a pointer to b(). As soon as the application doesn't need a() anymore, it dlclose()s liba.so. Expected result: the pointer to b() is still valid and can be called Actual result: the pointer to b() has become invalid, even though the application did not dlclose() the handle to libb.so. On calling b(), the application crashes with a segmentation fault. PR: misc/151861 Based on patch by: jh Reviewed by: kan Tested by: Arjan van Leeuwen <freebsd-maintainer opera com> MFC after: 1 week
* Add a new libc function: cfmakesane(3).ed2010-11-022-9/+12
| | | | | | | | | | | I've noticed various terminal emulators that need to obtain a sane default termios structure use very complex `hacks'. Even though POSIX doesn't provide any functionality for this, extend our termios API with cfmakesane(3), which is similar to the commonly supported cfmakeraw(3), except that it fills the termios structure with sane defaults. Change all code in our base system to use this function, instead of depending on <sys/ttydefaults.h> to provide TTYDEF_*.
* Unbreak ia64.marcel2010-10-222-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | With r169630 I disabled symbol versioning because it broke rtld. With r211706 rtld got broken for ia64 & powerpc64. It was fixed for powerpc64 with r212497. In between, r211749 removed the exports table because the version script handled the exports. But wait, symbol versioning was disabled on ia64. With exports controlled by the version script and symbol versioning disabled, all symbols are exported and too many symbols bind to the definition in rtld. Let's just say that waird things happen. So, enable symbol versioning on ia64 and apply a work-around for the SIGSEGV that triggered r169630 to begin with: when rtld relocates itself, it comes across r_debug_state and for some reason can't find the definition. This causes a failure, relocation aborts and null pointers galore. The work-around is to ignore the missing definition when rtld is relocating itself and keep going. Maybe with the next binutils this will all go away. Maybe not, in which case I still need to figure out why r_debug_state cannot be found. BTW: r_debug_state is in the symbol map -- I don't think any other rtld symbols that rtld references are in the symbol map...
* mdoc: drop even more redundant .Pp callsuqs2010-10-191-1/+0
| | | | | | No change in rendered output, less mandoc lint warnings. Tool provided by: Nobuyuki Koganemaru n-kogane at syd.odn.ne.jp
* mdoc: drop redundant .Pp and .LP callsuqs2010-10-083-4/+0
| | | | They have no effect when coming in pairs, or before .Bl/.Bd
* Use a defined FreeBSD version.delphij2010-10-061-2/+2
| | | | MFC after: 3 days
* Fix two subtle problems in PPC32 RTLD. The first is a concurrency issuenwhitehorn2010-10-041-2/+5
| | | | | | | | | where long PLT calls in multi-threaded environments could end up with incorrect jmptab values. The second is that, after the addition of extended PLT support, I forgot to update the PLT icache synchronization code to cover the extended PLT instead of just the basic PLT. MFC after: 10 days
* Remove the duplicate logging of failed read requests, whose error messagemarius2010-09-241-1/+0
| | | | | | | | | also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not just the case the -n option is intended to deal with and thus really spammed us with ~20 messages in the default configuration when booting a diskless FreeBSD client, introduced with r207608 again. MFC after: 1 week
* Make WARNS=6 clean.marius2010-09-246-44/+37
| | | | MFC after: 1 week
* Try to adhere to style.Makefile(5).marius2010-09-231-5/+3
| | | | MFC after: 3 days
* Move the pfrom initialization from before the setjmp to after theimp2010-09-151-2/+1
| | | | setjmp to avoid warnings on the powerpc build...
* Remove an explicit assignment of the CFLAGS variable intended forrpaulo2010-09-151-1/+0
| | | | debugging purposes only.
* Check for undefined weak symbols during PLT binding on powerpc64, and donwhitehorn2010-09-123-3/+9
| | | | | | | not attempt to copy NULL function descriptors. This fixes LD_BIND_NOW on powerpc64 after r211706. Reviewed by: kib
* Fix incorrect usage of 'assure' and 'insure'.brucec2010-08-281-1/+1
| | | | Approved by: rrs (mentor)
* Make RTLD work on powerpc64 again. If there is a sub-directory namednwhitehorn2010-08-241-7/+10
| | | | | | MACHINE_ARCH, use that specific one, otherwise use MACHINE_CPUARCH. Reviewed by: imp
* Remove exports table. Export control by the version script is enough.kib2010-08-241-50/+4
| | | | | Reviewed by: kan MFC after: 3 weeks
* MFtbemd:imp2010-08-233-9/+13
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* On shared object unload, in __cxa_finalize, call and clear all installedkib2010-08-231-0/+12
| | | | | | | | | | | | | | | | | | | | | | atexit and __cxa_atexit handlers that are either installed by unloaded dso, or points to the functions provided by the dso. Use _rtld_addr_phdr to locate segment information from the address of private variable belonging to the dso, supplied by crtstuff.c. Provide utility function __elf_phdr_match_addr to do the match of address against dso executable segment. Call back into libthr from __cxa_finalize using weak __pthread_cxa_finalize symbol to remove any atfork handler which function points into unloaded object. The rtld needs private __pthread_cxa_finalize symbol to not require resolution of the weak undefined symbol at initialization time. This cannot work, since rtld is relocated before sym_zero is set up. Idea by: kan Reviewed by: kan (previous version) MFC after: 3 weeks
* Introduce implementation-private rtld interface _rtld_addr_phdr, whichkib2010-08-232-10/+38
| | | | | | | | fills struct dl_phdr_info for the shared object that contains the specified address, if any. Idea and reviewed by: kan MFC after: 3 weeks
* Provide the starting image with the pointer to ELF aux vector. It iskib2010-08-171-0/+1
| | | | | | | | written into the __elf_aux_vector variable, if the symbol is present. Idea from: kan Tested by: marius (sparc64) MFC after: 1 month
* Use the newly provided aux vectors to get pagesize and osreldate information.kib2010-08-172-10/+84
| | | | | | | | | | | | | | | | | | Use local version of getpagesize(), rtld_getpagesize() in private allocator. Override the __getosreldate() previously fetched from libc_pic.a with local version that uses aux value if present. Note that __getosreldate() is used by rtld indirectly, by mmap(2) libc wrapper. To be able to utilize aux, split digest_dynamic() for use by init_rtld() into two parts, where the first one does not call malloc(), and the second part uses it. init_rtld() is able to initialize global variables before digest_dynamic2() calls. In particular, pagesize and osreldate are set up from the aux values. Now, rtld avoids (two) sysctl calls in startup. Tested by: marius (sparc64) MFC after: 1 month
* Add parentheses around the argument 'x' used in the __bswapXX(x) macros. Revertneel2010-08-111-1/+1
| | | | | | | | | r211130 in favor of this more general fix. This fixes a compilation error for mips 64-bit little endian build. libexec/rtld-elf/mips/reloc.c:196: warning: right shift count >= width of type Suggested by: stefanf, jchandra, bde
* Fix compilation error for 64-bit little endian build:neel2010-08-101-2/+2
| | | | | | | libexec/rtld-elf/mips/reloc.c:196: warning: right shift count >= width of type When the expression '(r_info) >> 32' was passed to bswap32() it was promptly changed to '(uint32_t)(r_info) >> 32' which is not what we intended.
* Remove unneeded use of struct timezone.ed2010-08-082-6/+4
| | | | | We can safely call gettimeofday() without passing a struct timezone. We're not using it at all.
* Fix typos and spelling mistakes.joel2010-08-061-1/+1
|
* Fix typo.joel2010-08-041-1/+1
|
* 64 bit support for MIPS rtld.jchandra2010-07-292-10/+17
| | | | | - Handle the case where pltgot[1] is 64 bit. - use 'ifdef __mips_n64' instead of 'ELFSIZE == 64' to detect 64 bit compile.
* RTLD support for powerpc64. A few small modifications to the Makefilenwhitehorn2010-07-106-0/+741
| | | | | | | | | | | | | and symbol map are required to support various consequences of the dot symbol scheme: - Symbols beginning with a dot are reserved, so start private symbols with an underscore. - In order to set RTLD breakpoints, gdb must be able to locate the text entry point, not the data section function descriptor, so add .r_debug_state to the symbol map on powerpc64. Obtained from: projects/ppc64
* Revert r209544. It papers over a binutils bug, and is not even a reliablenwhitehorn2010-06-281-10/+3
| | | | | | | | | | | | | fix for it. The bug occurs when using the --as-needed flag to ld in the presence of synthetic linker-generated symbols that reference symbols defined in linked-to shared libraries with versioned symbols. When the only symbols used from a library fall into this category, ld will drop the DT_NEEDED entry for it, but retain the versioning information. This bug is best fixed/hacked around in binutils, not in rtld. Discussed with: kan
* Ignore versioned dependencies on shared objects to which we do not link.nwhitehorn2010-06-261-3/+10
| | | | | This fixes an error with files like this created by GNU ld under certain circumstances.
* Merge jmallett@'s n64 work into HEAD - changeset 3jchandra2010-06-161-3/+5
| | | | | | | | Update rtld MIPS code to use assembly macros that work on o32/n64. Changes from http://svn.freebsd.org/base/user/jmallett/octeon Approved by: rrs(mentor), jmallett
* Plug possible memory leak.kan2010-06-031-1/+3
| | | | | Found by: Coverity MFC after: 2 weeks
* mdoc: use literal text, not a column table to present theuqs2010-06-021-8/+8
| | | | configuration file snippet.
* Only use the cache after the early stage of loading. This isrdivacky2010-05-186-33/+29
| | | | | | | | | | because calling mmap() etc. may use GOT which is not set up yet. Use calloc() instead of mmap() in cases where this was the case before (sparc64, powerpc, arm). Submitted by: Dimitry Andric (dimitry andric com) Reviewed by: kan Approved by: ed (mentor)
* Final update to current version of head in preparation for reintegration.mckusick2010-05-0613-502/+2418
|\
| * Bring in new files from edwin's tftpimp2010-05-0410-0/+2064
| |
| * Go ahead and merge the work edwin@ on tftpd into the tree. It is aimp2010-05-043-502/+354
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lot better than what's in the tree now. Edwin tested it at a prior employer, but can't test it today. I've found that it works a lot better with the various uboot versions that I've used in my embedded work. Here's the pkg-descr from the port that describes the changes: It all started when we got some new routers, which told me the following when trying to upload configuration or download images from it: The TFTP server doesn't support the blocksize option. My curiousity was triggered, it took me some reading of RFCs and other documentation to find out what was possible and what could be done. Was plain TFTP very simple in its handshake, TFTP with options was kind of messy because of its backwards capability: The first packet returned could either be an acknowledgement of options, or the first data packet. Going through the source code of src/libexec/tftpd and going through the code of src/usr.bin/tftp showed that there was a lot of duplicate code, and the addition of options would only increase the amount of duplicate code. After all, both the client and the server can act as a sender and receiver. At the end, it ended up with a nearly complete rewrite of the tftp client and server. It has been tested against the following TFTP clients and servers: - Itself (yay!) - The standard FreeBSD tftp client and server - The Fedora Core 6 tftp client and server - Cisco router tftp client - Extreme Networks tftp client It supports the following RFCs: RFC1350 - THE TFTP PROTOCOL (REVISION 2) RFC2347 - TFTP Option Extension RFC2348 - TFTP Blocksize Option RFC2349 - TFTP Timeout Interval and Transfer Size Options RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) It supports the following unofficial TFTP Options as described at http://www.compuphase.com/tftp.htm: blksize2 - Block size restricted to powers of 2, excluding protocol headers rollover - Block counter roll-over (roll back to zero or to one) From the tftp program point of view the following things are changed: - New commands: "blocksize", "blocksize2", "rollover" and "options" - Development features: "debug" and "packetdrop" If you try this tftp/tftpd implementation, please let me know if it works (or doesn't work) and against which implementaion so I can get a list of confirmed working systems. Author: Edwin Groothuis <edwin@FreeBSD.org>
* | Update to current version of head.mckusick2010-04-287-168/+366
|\ \ | |/
| * Forgot to initialize the debug variable.des2010-04-011-1/+1
| | | | | | | | MFC after: 2 weeks
| * Add a debugging option (-d)des2010-04-012-12/+47
| | | | | | | | | | | | Add a -k option which fingerd(8) passes through to finger(1). MFC after: 2 weeks
| * Check that gl_pathc is bigger than zero before derefencing gl_pathv.delphij2010-03-251-1/+2
| | | | | | | | | | | | | | | | | | When gl_pathc == 0, the content of gl_pathv is undefined. PR: bin/144761 Submitted by: David BERARD <contact davidberard fr> Obtained from: OpenBSD MFC after: 1 week
| * - Remove const'ness from dlerror(3) prototype, for consistency with POSIX.gahr2010-03-241-1/+1
| | | | | | | | | | Approved by: cognet MFC after: 1 week
| * Fix several typos in macros or macro misusage.uqs2010-03-121-1/+1
| | | | | | | | | | | | Found by: make manlint Reviewed by: ru Approved by: philip (mentor)
| * Updated rtld for n32 support.imp2010-03-042-153/+315
| | | | | | | | | | Submitted by: jmallet@ Obtained from: NetBSD
OpenPOWER on IntegriCloud