aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* MFC r222825: Remove a gratuitous newline.Jaakko Heinonen2011-07-031-1/+1
| | | | | | | PR: bin/153667 Notes: svn path=/stable/8/; revision=223733
* MFC r220004: rtld: eliminate double call to close(2) that may occur in ↵Andriy Gapon2011-04-081-5/+2
| | | | | | | load_object Notes: svn path=/stable/8/; revision=220440
* MFC: r219340, r219531, r219533Marius Strobl2011-03-251-5/+90
| | | | | | | | | | | - Add support for TLS relocations. - Emitt an error when encountering an unsupported and in case of the kernel also for unaligned relocations. - Fix R_SPARC_HIX22 and R_SPARC_LOX10 relocations. Apparently these are hardly ever used. Notes: svn path=/stable/8/; revision=219996
* MFC: r219339, r219532Marius Strobl2011-03-231-102/+95
| | | | | | | | | | | | | | | | - Remove clause 3 and 4 from TNF licenses. [1] - Add the _RF_X committed in r212998 (merged to stable/8 in r213478) also to the tables in the sparc64 reloc.c in order reduce differences between the kernel and the userland source. This results in no functional change though. - Consistently abbreviate the names of the relocations. - End sentences with dots. - Fix whitespace. Obtained from: NetBSD [1] Notes: svn path=/stable/8/; revision=219940
* MFC r216489:Jaakko Heinonen2011-03-031-16/+38
| | | | | | | | | | | | | | | | | | | | If dlclose() is called recursively from a _fini() function, the inner dlclose() call may unload the object of the outer call prematurely because objects are unreferenced before _fini() calls. Fix this by unreferencing objects after calling objlist_call_fini() in dlclose(). Therefore objlist_call_fini() now calls the fini function if the reference count of an object is 1. In addition we must restart the list_fini traversal after every _fini() call because another dlclose() call might have modified the reference counts. Add an XXX comment to objlist_call_fini() about possible race with dlopen(). PR: 133246, 149464 Notes: svn path=/stable/8/; revision=219237
* MFC r218098:Konstantin Belousov2011-02-061-4/+13
| | | | | | | | | | Make ldd(1) work when versioned dependency file is cannot be loaded. MFC r218099: Fix grammar. Notes: svn path=/stable/8/; revision=218365
* MFC r218025:Sergey Kandaurov2011-01-311-1/+1
| | | | | | | | | Remove SuperH architecture from a comment. Approved by: kib (mentor) Notes: svn path=/stable/8/; revision=218126
* MFC 216943, 216945:Ed Maste2011-01-111-1/+5
| | | | | | | | | Handle failure from ftpd_popen in statfilecmd(). Make format string a string literal. (Discovered by clang.) Notes: svn path=/stable/8/; revision=217249
* Merge MIPS platform support to 8-STABLE.Jayachandran C.2010-11-272-155/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit merges the MIPS platform changes that was now stable in -CURRENT into 8-STABLE. The MIPS changesets are too many (~400) to list here. But the changesets merged in this commit that affect other platforms are summarized below: r204635 : (changes to sys/dev/hwpmc, lib/libpmc, sys/sys/pmc.h) Add support for hwpmc(4) on the MIPS 24K, 32 bit, embedded processor. r205845: (changes to sys/modules/Makefile) Fix for building modules on mips and arm. r204031: (changes to sys/kern/link_elf_obj.c) printf fix, as part of kernel module support for MIPS. r206404: (changes to sys/arm/include/bus.h) Add BUS_SPACE_UNRESTRICTED and define it to be ~0, just like all the other platforms - for arm and mips. r206819: (changes to sys/vm/) Add VMFS_TLB_ALIGNED_SPACE option and kmem_alloc_nofault_space(), which is used to allocate kernel stack address on MIPS. r208165, r211087: (sys/kern/subr_smp.c, sys/kern/sched_ule.c) Enable ULE scheduler for MIPS, Fix for an issue in SMP when 32 cpus are enabled. r208659: (sys/{ia64/ia64,mips/mips,sun4v/sun4v}/pmap.c) Simplify the inner loop of get_pv_entry() r208794: (changes to sys/vm/) Make vm_contig_grow_cache() extern, and use it when vm_phys_alloc_contig() fails to allocate MIPS page table pages. r210327: (changes to sys/vm/) Support for MIPS page table page allocation. Add a new function 'vm_page_t vm_page_alloc_freelist(int flind, int order, int req)' to vm/vm_page.c to allocate a page from a specified freelist, and other related changes. Reviewed by: alc(vm changes only) Approved by: kib(re), alc(vm), imp(mips), jmallett(mips), gnn(mips pmc) Notes: svn path=/stable/8/; revision=215938
* MFC: r201217: ANSIfy ldconfig and the aout bits it still uses from rtld-aoutDavid E. O'Brien2010-11-252-28/+10
| | | | Notes: svn path=/stable/8/; revision=215814
* MFC r215034:Rebecca Cran2010-11-201-1/+1
| | | | | | | | | | Fix typos. PR: bin/148894 Submitted by: olgeni Notes: svn path=/stable/8/; revision=215588
* MFC r214728:Konstantin Belousov2010-11-102-2/+14
| | | | | | | | | | | | | | | | | | | | | If dlopen() is called for the dso that has been already loaded as a 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. MFC r214776: Fix style. MFC r214777: Change init_dag() to not increment DAG refcount. Unconditionally call both init_dag() and ref_dag() in dlopen() for the case when the object was already loaded. Notes: svn path=/stable/8/; revision=215084
* MFC r213406:Nathan Whitehorn2010-10-141-2/+5
| | | | | | | | | | | Fix two subtle problems in PPC32 RTLD. The first is a concurrency issue 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. Notes: svn path=/stable/8/; revision=213833
* MFC r213488:Xin LI2010-10-091-2/+2
| | | | | | | Use a defined FreeBSD version. Notes: svn path=/stable/8/; revision=213641
* MFC: r213102Marius Strobl2010-10-041-1/+0
| | | | | | | | | | | | Remove the duplicate logging of failed read requests, whose error message 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 (commited to stable/8 in 213038) again. Notes: svn path=/stable/8/; revision=213419
* MFC: r213099Marius Strobl2010-10-046-44/+38
| | | | | | | Make WARNS=6 clean. Notes: svn path=/stable/8/; revision=213417
* MFC: 213075Marius Strobl2010-10-041-5/+3
| | | | | | | Try to adhere to style.Makefile(5). Notes: svn path=/stable/8/; revision=213415
* MFC: r207608, r207614, r212651, r212665Marius Strobl2010-09-2213-497/+2414
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Go ahead and merge the work edwin@ on tftpd into the tree. It is a 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> Notes: svn path=/stable/8/; revision=213038
* MFC: r205076 (partial)Marius Strobl2010-09-221-1/+1
| | | | | | | | | | | Fix several typos in macros or macro misusage. Found by: make manlint Reviewed by: ru Approved by: philip (mentor) Notes: svn path=/stable/8/; revision=213030
* MFC r208763:Alexander Kabaev2010-06-181-1/+3
| | | | | | | | | Plug possible memory leak. Found by: Coverity Prevent Notes: svn path=/stable/8/; revision=209303
* MFC r205656:Xin LI2010-04-011-1/+2
| | | | | | | | | | | | Check that gl_pathc is bigger than zero before derefencing gl_pathv. When gl_pathc == 0, the content of gl_pathv is undefined. PR: bin/144761 Submitted by: David BERARD <contact davidberard fr> Obtained from: OpenBSD Notes: svn path=/stable/8/; revision=206025
* MFC r205606Pietro Cerutti2010-03-311-1/+1
| | | | | | | | | Remove const'ness from dlerror(3) prototype, for consistency with POSIX. Approved by: cognet Notes: svn path=/stable/8/; revision=205979
* MFC r204211:Nathan Whitehorn2010-03-203-25/+67
| | | | | | | | Support the extended PLT format used when objects have more than 8192 PLT relocations on PPC32. Notes: svn path=/stable/8/; revision=205383
* MFC r199829:Konstantin Belousov2009-12-172-14/+35
| | | | | | | | | | | | | Implement rtld part of the support for -z nodlopen (see ld(1)). MFC r199877: Allow to load not-openable dso when tracing. This fixes ldd on such dso or dso linked to non-openable object. Remove '\n' at the end of error message. End comments with dot. Notes: svn path=/stable/8/; revision=200645
* Merge r199270 from head to stable/8:Robert Watson2009-12-141-1/+1
| | | | | | | Fix white space in rtld runtime error printf. Notes: svn path=/stable/8/; revision=200512
* Merge r197808 from head to stable/8:Robert Watson2009-12-141-1/+1
| | | | | | | | | | | | In rtld's map_object(), use pread(..., 0) rather than read() to read the ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek privileges on the file descriptor during run-time linking. Sponsored by: Google Notes: svn path=/stable/8/; revision=200509
* MFC r199979: Fix local root vulnerability.Colin Percival2009-12-011-6/+6
| | | | Notes: svn path=/stable/8/; revision=199980
* MFC r199828:Konstantin Belousov2009-11-291-1/+1
| | | | | | | Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN. Notes: svn path=/stable/8/; revision=199907
* MFC r197931:Konstantin Belousov2009-10-201-14/+15
| | | | | | | | | Apply relocations for PIE binary ELF data structures pointers in rtld. Approved by: re (kensmith) Notes: svn path=/stable/8/; revision=198280
* MFC r196787Remko Lodder2009-09-071-1/+0
| | | | | | | | | | | | | | | | | | | | | Do the first step in removing lukemftpd from the base system. Disconnect it from the build. If you are using the FTP daemon, please consider using the port ftp/tnftpd which is the same FTP server, but newer and might have more/better functionality. This results in us providing only one ftp daemon by default. Reviewed by: bz Approved by: imp (mentor, implicit) MFC after: 3 days Silence from: obrien Approved by: re (kib), imp (mentor, implicit) Notes: svn path=/stable/8/; revision=196926
* Implement RTLD_NOLOAD flag for dlopen(3).Konstantin Belousov2009-07-171-6/+10
| | | | | | | | | Requested and tested by: jkim Reviewed by: kan Approved by: re (kensmith) Notes: svn path=/head/; revision=195745
* Only perform .bss mapping and cleaning operations when segment file sizeKonstantin Belousov2009-07-171-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | is not equal to its memory size. This eliminates unneeded clearing of the text segment that often happens due to text end not being page-aligned. For instance, $ readelf -l /lib/libedit.so.6 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x00000000 0x00000000 0x139e1 0x139e1 R E 0x1000 LOAD 0x014000 0x00014000 0x00014000 0x00f04 0x00f14 RW 0x1000 DYNAMIC 0x014cc4 0x00014cc4 0x00014cc4 0x000d0 0x000d0 RW 0x4 $ procstat -v $$ (for /bin/sh) 68585 0x28097000 0x280aa000 r-x 6 0 21 14 CN vn /lib/libedit.so.6 68585 0x280aa000 0x280ab000 r-x 1 0 1 0 CN vn /lib/libedit.so.6 <== 68585 0x280ab000 0x280ac000 rwx 1 0 1 0 CN vn /lib/libedit.so.6 Note the splitted map entry marked by '<=='. Reviewed by: kan Approved by: re (kensmith) MFC after: 1 month Notes: svn path=/head/; revision=195743
* Second attempt at eliminating .text relocations in shared librariesAlexander Kabaev2009-07-141-1/+1
| | | | | | | | | | | | | | | | | compiled with stack protector. Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work every time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kib) Notes: svn path=/head/; revision=195697
* Back out previous revision until better tested fix is ready.Alexander Kabaev2009-06-291-1/+1
| | | | | | | Approved by: re (impliciti, by approving previos check-in) Notes: svn path=/head/; revision=195152
* Eliminate .text relocations in shared libraries compiled with stack protector.Alexander Kabaev2009-06-281-1/+1
| | | | | | | | | | | | | | | Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work everys time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kensmith) Notes: svn path=/head/; revision=195151
* Fix a typo in the same comment, one line below.Ed Schouten2009-06-231-1/+1
| | | | | | | Submitted by: bf1783 googlemail com Notes: svn path=/head/; revision=194705
* Fix typo in comment.Ed Schouten2009-06-231-1/+1
| | | | | | | Submitted by: Christoph Mallon Notes: svn path=/head/; revision=194689
* Allow order of initialization of loaded shared objects to beAlexander Kabaev2009-06-202-48/+47
| | | | | | | | | | | | | | | | | | | | altered through their .init code. This might happen if init vector calls dlopen on its own and that dlopen causes some not yet initialized object to be initialized earlier as part of that dlopened DAG. Do not reset module reference counts to zero on final fini vector run when process is exiting. Just add an additional parameter to force fini vector invocation regardless of current reference count value if object was not destructed yet. This allows dlclose called from fini vector to proceed normally instead of failing with handle validation error. Reviewed by: kib Reported by: venki kaps Notes: svn path=/head/; revision=194531
* FreeBSD returns main object handle from dlopen(NULL, ...) calls.Alexander Kabaev2009-06-161-0/+10
| | | | | | | | | | | | | dlsym seaches using this handle are expected to look for symbol definitions in all objects loaded at the program start time along with all objects currently in RTLD_GLOBAL scope. Discussed with: kib Reported by: Maho NAKATA MFC after: 2 weeks Notes: svn path=/head/; revision=194298
* Increase the size of the static TLS area slightly (required for the NVidia'sDoug Rabson2009-05-271-1/+1
| | | | | | | OpenGL driver on amd64). Notes: svn path=/head/; revision=192922
* Per the man page:Doug Barton2009-05-264-164/+0
| | | | | | | | | | | | The makekey utility has been deprecated and will be removed in a future release of FreeBSD. Actually removing it was approved back on 10/29/2007 by re (kensmith) but I dropped the ball on actually removing it. It's doubtful that it's become more relevant/useful in the intervening time. Notes: svn path=/head/; revision=192776
* Prefer <sys/param.h> to <machine/param.h> for the definition ofRobert Watson2009-04-201-1/+1
| | | | | | | | | | CACHE_LINE_SIZE. Submitted by: bde MFC after: 2 weeks Notes: svn path=/head/; revision=191303
* Explicitly include machine/param.h for CACHE_LINE_SIZE.Robert Watson2009-04-191-0/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=191292
* Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, useRobert Watson2009-04-197-14/+0
| | | | | | | | | | | that definition in the custom locking code for the run-time linker rather than local definitions. Pointed out by: tinderbox MFC after: 2 weeks Notes: svn path=/head/; revision=191291
* Currently, when mapping an object, rtld reserves the whole address spaceKonstantin Belousov2009-04-101-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for the mapping by the object' file with the protection and mode of the first loadable segment over the whole region. Then, it maps other segments at the appropriate addresses inside the region. On amd64, due to default alignment of the segments being 1Gb, the subsequent segment mappings leave the holes in the region, that usually contain mapping of the object' file past eof. Such mappings prevent wiring of the address space, because the pages cannot be faulted in. Change the way the mapping of the ELF objects is constructed, by first mapping PROT_NONE anonymous memory over the whole range, and then mapping the segments of the object over it. Take advantage of this new order and allocate .bss by changing the protection of the range instead of remapping. Note that we cannot simply keep the holes between segments, because other mappings may be made there. Among other issues, when the dso is unloaded, rtld unmaps the whole region, deleting unrelated mappings. The kernel ELF image activator does put the holes between segments, but this is not critical for now because kernel loads only executable image and interpreter, both cannot be unloaded. This will be fixed later, if needed. Reported and tested by: Hans Ottevanger <fbsdhackers beasties demon nl> Suggested and reviewed by: kan, alc Notes: svn path=/head/; revision=190885
* Update comment to the reality, rtld supports any number of loadable segments.Konstantin Belousov2009-04-101-3/+2
| | | | | | | | | Fix spacing. Reviewed by: kan Notes: svn path=/head/; revision=190883
* Move variable externs into extern.h so they are checked against the definitions.David E. O'Brien2009-04-073-30/+29
| | | | Notes: svn path=/head/; revision=190828
* Allow the NULL, RTLD_SELF and RTLD_NEXT handles to work with dlfunc(3).Konstantin Belousov2009-04-032-0/+15
| | | | | | | | | | | | | | | | | | | dlfunc() called dlsym() to do the work, and dlsym() determines the dso that originating the call by the return address. Due to this, dlfunc() operated as if the caller is always the libc. To fix this, move the dlfunc() to rtld, where it can call the internal implementation of dlsym, and still correctly fetch return address. Provide usual weak stub for the symbol from libc for static binaries. dlfunc is put to FBSD_1.0 symver namespace in the ld.so export to override dlfunc@FBSD_1.0 weak symbol, exported by libc. Reported, analyzed and tested by: Tijl Coosemans <tijl ulyssis org> PR: standards/133339 Reviewed by: kan Notes: svn path=/head/; revision=190673
* Document RTLD_NODELETE, -z nodelete and -z origin support.Konstantin Belousov2009-04-011-1/+20
| | | | Notes: svn path=/head/; revision=190624
* Use RTF_LLDATA.Olivier Houchard2009-03-311-1/+1
| | | | Notes: svn path=/head/; revision=190601