aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* MIPS rtld: report missing symbol rather than segfaultingEd Maste2015-04-051-1/+1
| | | | | | | | | | | This is only an interim fix; MIPS should be using the MI code instead, which does not have this issue. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D661 Notes: svn path=/head/; revision=281107
* Add support for thread local storage on arm64 to the runtime linker. TheAndrew Turner2015-04-032-6/+142
| | | | | | | | | | | | | ABI specifies that, for R_AARCH64_TLSDESC relocations, we use the symbol value, addend, and object tls offset to calculate the offset from the tls base. We then cache this value for future reference. Differential Revision: https://reviews.freebsd.org/D2183 Reviewed by: kib Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281014
* Make die available as rtld_die for use by MD relocation codeEd Maste2015-04-022-20/+20
| | | | | | | | | Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2213 Notes: svn path=/head/; revision=281005
* Correct copyright typoEd Maste2015-03-311-1/+1
| | | | Notes: svn path=/head/; revision=280908
* Add the arm64 code to the runtime linker. It's not able to be built as weAndrew Turner2015-03-314-1/+515
| | | | | | | | | | | | still need libc_pic for a few things, but this is expected to be ready soon. Differential Revision: https://reviews.freebsd.org/D2136 Reviewed by: kib Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=280903
* Change compiler setting to make default visibility of the symbols forKonstantin Belousov2015-03-2912-16/+43
| | | | | | | | | | | | | | rtld on x86 to be hidden. This is a micro-optimization, which allows intrinsic references inside rtld to be handled without indirection through PLT. The visibility of rtld symbols for other objects in the symbol namespace is controlled by a version script. Reviewed by: kan, jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=280816
* When a file is executed and the path starts with `/', AT_EXECPATH is setJung-uk Kim2015-02-271-8/+7
| | | | | | | | | | | | without any translation. If the file is a symbolic link, $ORIGIN may not be expanded to the actual origin. Use realpath(3) to properly expand $ORIGIN to its absolute path. Reviewed by: kib MFC after: 1 week Notes: svn path=/head/; revision=279364
* Add the following options to enable/disable several features in the base systemEnji Cooper2015-02-041-6/+24
| | | | | | | | | | | | | | | | | | WITHOUT_BOOTPARAMD - bootparamd WITHOUT_BOOTPD - bootpd WITHOUT_FINGER - finger, fingerd WITHOUT_FTP - ftp, ftpd WITHOUT_INETD - inetd WITHOUT_RBOOTD - rbootd WITHOUT_TCP_WRAPPERS - tcpd, et al WITHOUT_TFTP - tftp, tftp-server WITHOUT_TIMED - timed MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=278192
* Use powerof2(). Remove single-use variable.Konstantin Belousov2015-01-301-5/+3
| | | | | | | | | Submitted by: Conrad Meyer Differential Revision: https://reviews.freebsd.org/D1724 MFC after: 1 week Notes: svn path=/head/; revision=277936
* Allow tracing dlfunc() / dlsym() events.Dag-Erling Smørgrav2015-01-251-4/+13
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=277695
* Add MK_TALK knob for building the talk and talkdEnji Cooper2015-01-251-1/+4
| | | | | | | | MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=277676
* Apply r246556 to powerpc:Justin Hibbits2015-01-061-5/+5
| | | | | | | | | | | | Avoid use of register variables, which some compilers (e.g. clang) don't like. It makes the code a little clearer as well. This allows a clang 3.5 built powerpc world to run (tested in a jail). MFC after: 1 week Notes: svn path=/head/; revision=276733
* Do not erronously export 'openat' symbol from rtld.Konstantin Belousov2015-01-041-1/+3
| | | | | | | | | | | | | | The symbol leaked after r276630 since lib/libc/sys/openat.c defines versions for openat using .symver (version script cannot assign two versions to one symbol), and rtld uses openat. Instead, directly use __sys_openat(). Reported and tested by: antoine Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=276646
* Add rtld private interface for dso to detect dynamic loadingKonstantin Belousov2015-01-033-0/+24
| | | | | | | | | | | vs. static linking. Tested by: pho, antoine (exp-run) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=276627
* Fix the following -Werror warning from clang 3.5.0, while buildingDimitry Andric2014-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | rtld-elf for powerpc 32 bit: libexec/rtld-elf/powerpc/reloc.c:486:6: error: taking the absolute value of unsigned type 'Elf_Addr' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value] if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^ libexec/rtld-elf/powerpc/reloc.c:486:6: note: remove the call to 'abs' since unsigned values cannot be negative if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^~~ 1 error generated. Cast 'offset' to int, since that was intended, and should be safe to do on architectures with 32-bit two's complement ints. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D1387 Notes: svn path=/head/; revision=276342
* The runtime linker needs to include a path to itself in the link mapJohn Baldwin2014-12-021-0/+2
| | | | | | | | | | | | | | | | | | it exports to the debugger. It currently has two choices: it can use a compiled-in path (/libexec/ld-elf.so.1) or it can use the path stored in the interpreter path in the binary being executed. The runtime linker currently prefers the second. However, this is usually wrong for compat32 binaries since the binary specifies the path of rtld on a 32-bit system (/libexec/ld-elf.so.1) instead of the actual path (/libexec/ld-elf32.so.1). For now, always assume the compiled in path (/libexec/ld-elf32.so.1) as the rtld path and ignore the path in the binary for the 32-bit runtime linker. Differential Revision: https://reviews.freebsd.org/D1236 Reviewed by: kib Notes: svn path=/head/; revision=275412
* Convert to LIBADDBaptiste Daroussin2014-11-2528-76/+34
| | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275077
* Revert r274772: it is not valid on MIPSEd Maste2014-11-251-1/+1
| | | | | | | Reported by: sbruno Notes: svn path=/head/; revision=275004
* Use canonical __PIC__ flagEd Maste2014-11-211-1/+1
| | | | | | | | | | | It is automatically set when -fPIC is passed to the compiler. Reviewed by: dim, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1179 Notes: svn path=/head/; revision=274772
* I agree w/ tedu that this isn't a Bug.. it's like complaining thatJohn-Mark Gurney2014-11-201-18/+2
| | | | | | | | | you can't use an ssh client to fetch a web page... Submitted by: tedu (via -tech) Notes: svn path=/head/; revision=274736
* Add baud rate support to telnet(1)Enji Cooper2014-11-111-0/+1
| | | | | | | | | | | | | | | | This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274364
* MFV: Import atf-0.21.Julio Merino2014-11-013-3/+7
| | | | Notes: svn path=/head/; revision=273929
* This is the much-discussed major upgrade to the random(4) device, known to ↵Mark Murray2014-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | you all as /dev/random. This code has had an extensive rewrite and a good series of reviews, both by the author and other parties. This means a lot of code has been simplified. Pluggable structures for high-rate entropy generators are available, and it is most definitely not the case that /dev/random can be driven by only a hardware souce any more. This has been designed out of the device. Hardware sources are stirred into the CSPRNG (Yarrow, Fortuna) like any other entropy source. Pluggable modules may be written by third parties for additional sources. The harvesting structures and consequently the locking have been simplified. Entropy harvesting is done in a more general way (the documentation for this will follow). There is some GREAT entropy to be had in the UMA allocator, but it is disabled for now as messing with that is likely to annoy many people. The venerable (but effective) Yarrow algorithm, which is no longer supported by its authors now has an alternative, Fortuna. For now, Yarrow is retained as the default algorithm, but this may be changed using a kernel option. It is intended to make Fortuna the default algorithm for 11.0. Interested parties are encouraged to read ISBN 978-0-470-47424-2 "Cryptography Engineering" By Ferguson, Schneier and Kohno for Fortuna's gory details. Heck, read it anyway. Many thanks to Arthur Mesh who did early grunt work, and who got caught in the crossfire rather more than he deserved to. My thanks also to folks who helped me thresh this out on whiteboards and in the odd "Hallway track", or otherwise. My Nomex pants are on. Let the feedback commence! Reviewed by: trasz,des(partial),imp(partial?),rwatson(partial?) Approved by: so(des) Notes: svn path=/head/; revision=273872
* Add an "empty" Makefile.pc98 because it doesn't need/want HYPERV. ItWarner Losh2014-10-161-0/+4
| | | | | | | is not relevant to the hardware it runs on. Notes: svn path=/head/; revision=273167
* HYPERV isn't available on all architectures, but just on by defaultWarner Losh2014-10-163-5/+12
| | | | | | | | | | | for i386/amd64. Rather, it only works on i386/amd64 and should only be built there. Rather than change the default based on which architecutre, do things more directly by only building it on i386/amd64 and having it always on. This is how we handle other options that are relevant only for a few architectures. Notes: svn path=/head/; revision=273155
* Always return pathname in dl_iterate_phdr's dlpi_name, as Linux doesEd Maste2014-10-091-2/+1
| | | | | | | | | | | | | | | Linux LD_ITERATE_PHDR(3): The dlpi_name field is a null-terminated string giving the pathname from which the shared object was loaded. That functionality is much more useful than returning just the short name. Approved by: kan Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=272842
* Remove MK_ARM_EABI, the armeb issues have been fixed. The code to supportAndrew Turner2014-10-011-1/+1
| | | | | | | | | | | | | | | the oabi is still in the tree, but it is expected this will be removed as developers work on surrounding code. With this commit the ARM EABI is the only supported supported ABI by FreeBSD on ARMa 32-bit processors. X-MFC after: never Relnotes: yes Differential Revision: https://reviews.freebsd.org/D876 Notes: svn path=/head/; revision=272350
* Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,Xin LI2014-09-132-0/+15
| | | | | | | | | | | | | | | | | many thanks for their continued support of FreeBSD. While I'm there, also implement a new build knob, WITHOUT_HYPERV to disable building and installing of the HyperV utilities when necessary. The HyperV utilities are only built for i386 and amd64 targets. This is a stable/10 candidate for inclusion with 10.1-RELEASE. Submitted by: Wei Hu <weh microsoft com> MFC after: 1 week Notes: svn path=/head/; revision=271493
* Document the whole settings needed to build a debug version of rtld.Konstantin Belousov2014-08-291-0/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=270803
* Optimize r270798, only do the second pass over non-plt relocationsKonstantin Belousov2014-08-294-3/+9
| | | | | | | | | | when the first pass found IFUNCs. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=270802
* IFUNC symbol type shall be processed for non-PLT relocations,Konstantin Belousov2014-08-299-334/+311
| | | | | | | | | | | | | | | | | | | | | | e.g. when a global variable is initialized with a pointer to ifunc. Add symbol type check and call resolver for STT_GNU_IFUNC symbol types when processing non-PLT relocations, but only after non-IFUNC relocations are done. The two-phase proceessing is required since resolvers may reference other symbols, which must be ready to use when resolver calls are done. Restructure reloc_non_plt() on x86 to call find_symdef() and handle IFUNC in single place. For non-x86 reloc_non_plt(), check for call for IFUNC relocation and do nothing, to avoid processing relocs twice. PR: 193048 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=270798
* Remove stray newline.Konstantin Belousov2014-08-271-1/+1
| | | | Notes: svn path=/head/; revision=270687
* Fix "make checkdpadd" by "spoofing" DPADDEnji Cooper2014-08-261-0/+1
| | | | | | | | | Approved by: jmmv (mentor) Phabric: D631 PR: 192769 Notes: svn path=/head/; revision=270649
* Always check the limits of array index variables before using them.Pedro F. Giffuni2014-08-211-2/+2
| | | | | | | | Obtained from: DragonFlyBSD MFC after: 1 week Notes: svn path=/head/; revision=270256
* Revert r267233 for now. PIE support needs to be reworked.Bryan Drewery2014-08-194-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other build-only utility libraries. 2. Another 40% is fixed by generating _pic.a variants of various libraries. 3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR) where it never would work anyhow, such as csu or loader. This suggests there may be better ways of adding support to the tree. Many of these cases can be fixed such that -fPIE will work but there is really no reason to have it in those cases. 4. Some of the uses are working around hacks done to some Makefiles that are really building libraries but have been using bsd.prog.mk because the code is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have been needed. We likely do want to enable PIE by default (opt-out) for non-tree consumers (such as ports). For in-tree though we probably want to only enable PIE (opt-in) for common attack targets such as remote service daemons and setuid utilities. This is also a great performance compromise since ASLR is expected to reduce performance. As such it does not make sense to enable it in all utilities such as ls(1) that have little benefit to having it enabled. Reported by: kib Notes: svn path=/head/; revision=270168
* Remove LOG_ODELAY because it does nothing.Neel Natu2014-08-172-2/+2
| | | | | | | | Reviewed by: jilles CR: https://reviews.freebsd.org/D611 Notes: svn path=/head/; revision=270111
* Rework privatelib/internallibBaptiste Daroussin2014-08-062-4/+2
| | | | | | | | | | | | | | | | | Make sure everything linking to a privatelib and/or an internallib does it directly from the OBJDIR rather than DESTDIR. Add src.libnames.mk so bsd.libnames.mk is not polluted by libraries not existsing in final installation Introduce the LD* variable which is what ld(1) is expecting (via LDADD) to link to internal/privatelib Directly link to the .so in case of private library to avoid having to complexify LDFLAGS. Phabric: https://phabric.freebsd.org/D553 Reviewed by: imp, emaste Notes: svn path=/head/; revision=269648
* Similar to r269506, fix LIBDIR to not duplicate TESTSDIREnji Cooper2014-08-051-2/+2
| | | | | | | | | | Phabric: D536 Reviewed by: jmmv Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=269600
* Remove unnecessary .PATH directiveEnji Cooper2014-08-051-2/+0
| | | | | | | | | | | | | All of the sources for the tests are contained in the current working directory and the subdirectories Phabric: D537 Reviewed by: jmmv Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=269599
* Fix BINDIR to not duplicate "${TESTSDIR}Enji Cooper2014-08-041-1/+1
| | | | | | | | | | | | This should fix 'make release' with MK_TESTS != no Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Notes: svn path=/head/; revision=269506
* Move a -L argument from LDADD to LDFLAGSEnji Cooper2014-08-041-1/+3
| | | | | | | | | | Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Notes: svn path=/head/; revision=269505
* Fix a -Wsecurity warning with clangEnji Cooper2014-08-041-1/+1
| | | | | | | | | | Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Notes: svn path=/head/; revision=269504
* Remove hardcoded path to TESTSDIR (Makefile, ld_library_pathfds.c) atEnji Cooper2014-08-042-12/+11
| | | | | | | | | | | | | | | | build time by using atf_tc_get_config_var(tc, "srcdir")) This will allow end-users to move the binaries to different locations after they've been built without having to rebuild the binaries with the new paths Phabric: D525 (part of a larger patch) Reviewed by: jmmv Approved by: jmmv (co-mentor) Notes: svn path=/head/; revision=269503
* Don't save entropy inside jails.Xin LI2014-07-221-0/+2
| | | | | | | | | | | | | As of r126744, we no longer feed the entropy device in jails upon start, and collecting them is no longer useful. PR: conf/126744 Submitted by: Eugene Grosbein <eugen grosbein net> (with minor changes) MFC after: 1 week Approved by: so (des) Notes: svn path=/head/; revision=268979
* Replace all uses of libncurses and libtermcap with their wide characterBrooks Davis2014-07-171-2/+2
| | | | | | | | | | | | | variants. This allows usable file system images (i.e. those with both a shell and an editor) to be created with only one copy of the curses library. Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=268804
* libpythagoras needs libm.Julio Merino2014-07-161-0/+3
| | | | | | | | This fixes "make tinderbox" failures on various architectures when WITH_TESTS=yes is enabled. Problem introduced in r267679. Notes: svn path=/head/; revision=268770
* Fix atf-sh's integration_testJulio Merino2014-07-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | With the move of atf-sh into /usr/libexec in r267181, some of the tests in the integration_test program broke because they could not execute atf-sh from the path any longer. This slipped through because I do have a local atf installation in my home directory that appears in my path, hence the tests could still execute my own version. Fix this by forcing /usr/libexec to appear at the beginning of the path when attempting to execute atf-sh. To make upgrading easy (and to avoid an unnecessary entry in UPDATING), make integration_test depend on the Makefile so that a rebuild of the shell script is triggered. This requires a hack in the *.test.mk files to ensure the Makefile is not treated as a source to the generated program. Ugly, I know, but I don't have a better way of doing this at the moment. Will think of one once I address the TODO in the *.test.mk files that suggests generalizing the file generation functionality. PR: 191052 Reviewed by: Garrett Cooper Notes: svn path=/head/; revision=268445
* Remove ia64.Marcel Moolenaar2014-07-075-997/+3
| | | | | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan Notes: svn path=/head/; revision=268351
* Align the stack in _rtld_bind_start. Normally this is called with theAndrew Turner2014-07-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | correct stack alignment, however when we have a leaf function that uses thread local storage it calls __aeabi_read_tp to get the thread pointer. Neither GCC or clang see this as a function call so will align the stack to a 4-byte boundary. This may be a problem as _rtld_bind expects to be on an 8-byte boundary. The solution is to store a copy of the stack pointer and force the alignment before calling _rtld_bind. This fixes a problem with armeb where applications would crash in odd ways. It should also remove the need for a local patch to clang to force the stack alignment to an 8-byte boundary, even for leaf functions. Further testing will be needed before reverting this local change to clang as we may rely on it in other places. Reviewed by: jmg@ Notes: svn path=/head/; revision=268310
* Fix r264346 for ia64. We need to allocate memory for the functionMarcel Moolenaar2014-07-022-0/+9
| | | | | | | | | | | | descriptors in order to relocate RTLD itself. To allocate memory, we need the pagesizes array initialized, but that happens after RTLD is relocated. This ordering is important for amd64, but it's opposite of what ia64 needs. Handle this conflict with the define called RTLD_INIT_PAGESIZES_EARLY. When defined, obtain the page sizes before relocating rtld, otherwise do it after. Notes: svn path=/head/; revision=268182