Commit Graph

3337 Commits

Author SHA1 Message Date
rmind 0dd7abe473 libnpf fix: link the library itself to libnv; libnpf users should not be
expected to assume this dependency.
2019-08-24 13:20:52 +00:00
brad ca50e52c93 Use getdiskrawname to find the device name
Reviewed by Christos
2019-08-22 20:28:08 +00:00
kamil d9a1e5d37f telnetd: Stop defining the same variables concurrently in bss and data
auth_level and require_secure_login were defined in two places:

 - global.c that picked it from headers and removed 'extern'
 - telnetd.c that initialized it to 0

line was defined twice: in global.c and sys_term.c with a non-zero value.
Remove the definition and initialization from sys_term.c and initialize
the variable early in main().

Detected during the build of telned with Address Sanitizer (MKSANITIZER).

Reviewed by <mrg>
2019-08-15 01:15:21 +00:00
uwe 8fd03c43d4 Tweak markup some more. 2019-07-15 01:26:15 +00:00
uwe c42a8ccb39 Improve (hopefully) mark up of the capabilities tables. 2019-07-12 03:32:41 +00:00
uwe 776605b5ed Use proper markup instead of .Em to refer to capabilities, structure
memebers, etc in the text (but not in the tables yet, as those require
more rework).
2019-07-12 01:53:45 +00:00
wiz 25c730350a Merge lines. Fixes display problem noted in PR 54361 by he@ 2019-07-11 09:48:22 +00:00
maya 3bb853ed54 r_symndx is no longer declared, use symnum and initialize it before use.
Completes the changes in the commit:
"Replace COMBREL with just-in-time check in _rtld_relocate_nonplt_objects."
http://mail-index.netbsd.org/source-changes/2017/06/19/msg085496.html
2019-04-15 19:13:03 +00:00
maya 53dcb847d9 $ORIGIN support is now enabled.
Thanks martin for the heads up.
2019-04-15 10:17:01 +00:00
abhinav 55eec9d71a Typo: s/a indirection/an indirection/ 2019-04-15 06:42:06 +00:00
wiz a30bc70869 Use more Dv. 2019-04-14 22:09:50 +00:00
maya 9a04775cfa Note that we now search DT_RUNPATH paths as well. 2019-04-14 20:27:02 +00:00
christos fb007af046 undo previous unlock/relock; it is not needed now that we added the tls model
declaration to all externs in jemalloc (suggested by joerg@)
2019-04-14 19:21:37 +00:00
christos 15018ca013 Fix c++ exceptions on arm; jemalloc calls _rtld_tls_get_addr from inside
dl_iterate_phdr, so we need to unlock and relock.
2019-04-13 03:15:25 +00:00
rin e66054b66e Do not compile __tls_get_addr() into ldd(1), which fixes ldd(1) crashing
on arm after switching to new jemalloc.

jemalloc invokes __tls_get_addr() under some condition. If anything other
than ld.elf_so nor libc exports it, inconsistency arises as a result.
2019-04-13 00:23:32 +00:00
christos 39fadeea40 Disable optimization for rtld.c on the vax with gcc-7. 2019-04-03 21:37:58 +00:00
martin 9e275c0f36 Account for cgihandler being set when counting the number of CGI environment
headers we are about to set. Avoids an assertion failure (and overruninng
the array) later.
2019-03-29 14:46:44 +00:00
mrg 58a223ca24 add $NetBSD$ 2019-03-27 04:50:30 +00:00
mrg 8b21018e17 on m68010 set BOZO_WRSZ to 16k and BOZO_WRSZ to 64k. 2019-03-08 03:12:28 +00:00
mrg 767fb2605a call this bozohttpd 20190228, and merge the CHANGES entries from the
previous release.
2019-02-28 09:16:42 +00:00
mrg 08dbfa234a add ssl specific timeout value (30s). if SSL_accept() doesn't
work with in this timeout value, ssl setup now fails.

mostly different from, but inspired from the patch in PR 50655
2019-02-28 08:28:21 +00:00
mrg f0885992ce - bump buffer sizes to avoid potential truncation issues 2019-02-04 04:36:41 +00:00
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
lukem fc9234654d clarify the fd used for blacklisting.
Use STDIN_FILENO instead of 0 as the fd to blacklist_r(),
since we use the former in ftpd.c
2019-01-29 23:19:30 +00:00
lukem 086f834b20 NetBSD-ftpd 20180428
Update version to "NetBSD-ftpd 20180428" for changes:
- Fix violations of the sequence point rule.
- Check that stat and fstat succeed.
- Support blacklistd(8) hooks.
- Clear utmpx struct before writing it to wtmpx files.
- Fix directory stream leaks.
- Use explicit_memset(3) instead of memset(3) to clear password.
- Fix scope of variable. PR misc/50665.
- Ensure that closing socket exists. CID 603440.
- Add -f option to ftpd to stay in foreground with -D. PR bin/53221.
2019-01-29 11:51:05 +00:00
dholland ad8aa774f5 fix duplicated chunk from merge 2019-01-27 04:33:29 +00:00
pgoyette d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
mrg 00e064adab o don't display special files in the directory index. they aren't
served, but links to them are generated.
2019-01-22 05:32:57 +00:00
skrll 69e8dca2e5 Adapt https://svnweb.freebsd.org/base?view=revision&revision=342113 to
NetBSD.

This brings us resolving for dynamically loaded libraries and makes
tests/libexec/ld.elf_so/t_thread_local_dtor pass.

With suggestions from joerg@
2019-01-18 11:59:03 +00:00
mrg 8f49d6e252 rework size_arrays():
- avoid calloc, use bozomalloc
- minor CSE
- fix bozoprefs->size setting when increasing the size (new total was
  being added to the prior total.)  found by clang static analyzer
  from rajeev_v_pillai.

pass httpd to size_arrays() now.
free(NULL) is legal.
2019-01-18 06:04:10 +00:00
mrg 5335936687 fix a few problems pointed out by clang static analyzer, from rajeev_v_pillai:
- bozostrnsep() may return with "in = NULL", so check for it.
- nul terminating in bozo_escape_rfc3986() can be simpler
- don't use uniinit variables in check_remap()
- don't use re-used freed data in check_virtual().  this one is tricky as
  the original code was:
	free(request->hr_file);
	request->hr_file = bozostrdup(httpd, request, s ? s : "/");
  however, bozostrdup() may reference request->hr_file.
2019-01-18 05:48:31 +00:00
mrg 9b91523ebd - call this 20190116
- adjust the directory indexing again:
  - don't include "index.html" in html headers
  - additional escaping of names
  - re-add top/bottom borders
  - adds an aquamarine table header
  - Zebra-stripes table rows using CSS instead of code
  all from "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>
2019-01-17 07:46:16 +00:00
mrg d1eeb82409 add 'check' target to toplevel makefile.
fix the t11.out output now that CGI parsing works better.
2019-01-17 07:39:00 +00:00
mrg 9c0805993a - fix CGI '+' param and error handling.
- remove unused parameter to daemon_poll_err().

both from "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>
2019-01-17 07:34:06 +00:00
christos d17b8a0ea7 print the program name when we don't find a library.
XXX: really most _rtld_error() should do that, and most do.
2019-01-12 18:58:10 +00:00
uwe 62a27ee607 Spell "occurrence" correctly. 2019-01-09 17:19:08 +00:00
mrg 4aff0e8a96 remove reference to deleted -r option. fixes PR#53840 from J. Lewis Muir. 2019-01-08 06:04:29 +00:00
joerg 06c9aa1116 When loading a non-PIE main binary, the virtual address must match.
Use MAP_TRYFIXED and verify that the result matches the expectation.
2019-01-06 19:44:54 +00:00
joerg 08e505b543 MAP_ALIGNED has existed for years, just assume it exists. 2019-01-04 19:54:56 +00:00
martin e4d02a93c7 Add support for DT_RUNPATH - it is just the same as we always have treated
DT_RPATH.  Approved by core.
2018-12-30 11:55:15 +00:00
christos d30b19ef3d - fix wrong reloc name in assert
- fix uninitialized
2018-12-30 03:23:46 +00:00
christos 61268f23da binutils 2.31.1 can put copy relocations in the relro segment. Delay
protecting the relro segment for the main object until copy relocations
are done.
2018-12-30 01:48:37 +00:00
christos 2c62c57fa6 initfini array support for everyone. 2018-12-27 18:58:14 +00:00
christos ba044c6310 explain why we skip objmain. 2018-12-27 18:57:43 +00:00
mrg 48003606bd minor rewording. fix alphabeta ordering of contributors. 2018-12-19 12:40:32 +00:00
mrg ff386e5b59 fix an old spell-o and a new format-o. 2018-12-18 23:11:40 +00:00
maya 79d3071f0c Remove mention of SPX. 2018-12-15 23:23:51 +00:00
leot 6816df1bc3 Document last changes and bump version to 20181215
Suggested by <mrg>, thanks! (Possible mistakes are mine though!)
2018-12-15 12:52:36 +00:00
leot 9644d25eb4 Fix handling of bozo_set_timeout() timeouts (and `-T' option parsing) 2018-12-15 12:43:24 +00:00
leot 6c2202365c Avoid .htpasswd exposure to authenticated users when .htpasswd is
in the slashdir too.

Problem reported by JP via tech-security@ and discussed with <mrg>, thanks!
2018-12-15 12:39:22 +00:00
leot 1f52a22c8c Avoid possible NULL dereference when sending a big request that timeout.
Problem reported by <maya> and reviewed by <maya> and <mrg>, thanks!
2018-12-15 09:28:27 +00:00
maya d6e51063d8 strings.h for strcasecmp (on linux) 2018-12-15 02:03:24 +00:00
maya 69e8cec185 Check against BOZO_HEADERS_MAX_SIZE in a way that isn't prone to overflow.
Note that this isn't reachable in practice as big requests time out.
2018-12-15 01:02:34 +00:00
maya 6807b854c1 Don't pass ${HOST} to test scripts.
htnl_cmp compares against the output of `hostname`.

This makes the tests pass on my machine.
2018-12-14 23:57:22 +00:00
sborrill 35d580002c IPFilter 5 requires you to specify IPv4 or IPv6 2018-12-13 13:11:28 +00:00
maya cd6150e9ad Remove unused macros. 2018-12-13 04:29:18 +00:00
mrg 34ece249a9 use html tables for directory index.
from "Rajeev V. Pillai" <rajeev_v_pillai@yahoo.com>

call this bozohttpd 20181204.
2018-12-04 02:52:42 +00:00
mrg 3d201ca797 avoid sign extension in % handling (and printing 0xFFFFFF before
wanted values.)  from Rajeev V. Pillai.
2018-12-04 00:26:15 +00:00
skrll 66b7511afb Fix typos 2018-12-01 13:01:57 +00:00
joerg 335f313f07 Now that lib/csu no longer uses the object handle, drop the magic and
version field from the internal object. It is kept in the legacy version
of the main object.
2018-11-26 17:40:26 +00:00
mrg a0c45e363d normalise some messages. 2018-11-25 23:48:14 +00:00
mrg cd79b847e8 add option fixes here. 2018-11-25 23:37:09 +00:00
mrg c53bc78857 fix -X option parsing. noted by Rajeev V. Pillai. 2018-11-25 07:37:20 +00:00
mrg ac81556715 avoid c99ism. 2018-11-24 18:38:59 +00:00
christos 201b0ce72c - add FALLTHROUGH comment
- one return is usually enough.
2018-11-24 13:08:10 +00:00
christos 47273da74b appease lint 2018-11-24 13:03:15 +00:00
christos 9034ab8ec4 one semicolon is usually enough. 2018-11-24 13:02:46 +00:00
mrg de8fdd6045 call this bozohttpd 20181124. 2018-11-24 02:35:13 +00:00
mrg 0e9761c130 fix a bug in the rework for -i option: move the real code in place.
for some reason gcc does not warn about this:

   case 'x':
     stuff_here();
     break;

     other_stuff_here();
     break;

and the other_stuff_here() was what was mis-placed.


should fix atf failures in networking.
2018-11-24 02:30:56 +00:00
mrg a49dff0c2c s/time/val/ to avoid shadowing a global indentifier. 2018-11-24 00:47:51 +00:00
skrll c7af211bee Fix RTLD_DEBUG_RELOC build 2018-11-23 11:26:05 +00:00
skrll 0d71550e67 Trailing whitespace 2018-11-23 10:59:20 +00:00
mrg ed71d0d525 minor style fixes. simplify bozo_match_content_map(). 2018-11-23 08:11:20 +00:00
mrg 7cb0de5ddc add an assert() check on array bounds. 2018-11-22 18:42:06 +00:00
mrg b0d9cf700a alpha sort the option switch. 2018-11-22 18:21:59 +00:00
mrg 4cfb2183d3 many clean ups:
- keep a list of special files and their human names
- remove (void) casts on bozo_http_error()
- fix a few more misuses of bozo_http_error()
- rename check_mapping() to check_remap() and perform some CSE
- switch away from ``%s'' to '%s'
- remove a bunch of #ifdef using new have_feature defines
2018-11-22 08:54:08 +00:00
mrg 32fa179b6e use MAP_SHARED for the bzremap file. avoids netbsd kernel complaining:
WARNING: defaulted mmap() share type to MAP_PRIVATE (pid 15478 command bozohttpd)
2018-11-21 17:39:19 +00:00
mrg b4624ca902 two fixes reported by mouse:
- don't check contents of 'st' if stat(2) failed.
- round up instead of truncate.  now 10000 byte files say 10kB not 9kB.
2018-11-21 10:25:17 +00:00
mrg a3912675bc - move special files defines into bozohttpd.h, so we can ...
- consolidate all the special file checks into
  bozo_check_special_files() so that all builds check the same
  list of special files, regardless of build options.
- convert "(void)bozo_http_error(...); return -1;" into plain
  "return bozo_http_error(...);"
- fix the call to bozo_check_special_files() to be used on all
  input types.  part of the fixes for failure to reject access
  to /.htpasswd as reported by JP on tech-security.
- use warn_unused_result attribute on bozo_check_special_files(),
  and fix the failures to return failure.  second part of the
  htpasswd access fix.
- update testsuite to use a fixed fake hostname.

call this bozohttpd 20181121.
2018-11-21 09:37:02 +00:00
mrg b091ab062f also fix have_dynamic_content from the previous previous. re-order
the debug and dynamic content to match the same pattern as everything
else so similar problems are less likely in the future.
2018-11-20 01:23:06 +00:00
mrg 75e07df53f fix previous: have_debug was reversed. 2018-11-20 01:19:51 +00:00
mrg cbabfa751a move some #if support into bozohttpd.h. 2018-11-20 01:15:50 +00:00
mrg 3230a9a3d5 from CHANGES:
o  reduce default timeouts, and add expand timeouts to handle the
   initial line, each header, and the total time spent
o  add -T option to expose new timeout settings
o  minor RFC fixes related to timeout handling responses

old timeouts:
60 seconds for initial request like, 60 seconds per header line,
and no whole timeout (though the recent total header size changes
do introduce one that would be about 11 hours.)
new timeouts:
30 seconds for initial request like, 10 seconds per header line,
and a total request time of 600 seconds.


the new global timeout is implemented using CLOCK_MONOTONIC, with
a fallback to CLOCK_REALTIME if monotonic time is unavailable.


reject multiple Host: headers.  besides being protocol standard,
this closes one additional memory leak found by JP.  add a simple
test to check this.


clean up option and usage handling some.
2018-11-20 01:06:46 +00:00
mrg 1520b40a61 note the changes present in bozohttpd 20181118:
o  add url remap support via .bzremap file, from martin@netbsd.org
o  handle redirections for any protocol, not just http:
o  fix a denial of service attack against header contents, which
   is now bounded at 16KiB.  reported by JP.
2018-11-19 04:14:59 +00:00
mrg 7b01d57a61 avoid memory leak in sending multiple auth headers.
mostly mitigated by previous patch to limit total header size,
but still a real problem here.
2018-11-19 04:13:09 +00:00
mrg 0ccc27dc69 fix a denial of service attack against header contents, which
is now bounded at 16KiB.  reported by JP.
2018-11-19 04:12:22 +00:00
mrg e2c37278b9 use __func__ in debug(). 2018-11-18 11:22:11 +00:00
kre 3e9d705017 sysctl(KERN_BOOTTIME) is a struct timespec, not struct timeval
and has eben since 2009.    Adapt.

NFCI - while the tv_usec (now tv_nsec) field is used, we will
keep its uses to microsecond precision to avoid any compat issues.
2018-10-30 21:18:39 +00:00
joerg 4312beab4f Move compatibility for pre-2.0 ELF binaries into separate file.
Early ELF binaries defined dlopen and friends in crt0.o by
using function pointers in the object handle passed from rtld.
This contract wastes space when many shared objects are allocated
and ties dynamic linker and rest of the system tightly together.
Fake the entry points in a static object and restrict them to the
platforms that had working ELF support at the time. Keep the magic and
version field used by modern crt0.o for all architectures. The checks
will be removed from crt0.o in a follow-up step.
2018-10-17 23:36:58 +00:00
rmind 39013e66c1 NPF: Major rework -- migrate NPF to the libnv library.
- This conversion significantly simplifies the code and moves NPF to
  a binary serialisation format (replacing the XML-like format).
- Fix some memory/reference leaks and possibly use-after-free bugs.
- Bump NPF_VERSION as this change makes libnpf incompatible with the
  previous versions.  Also, different serialisation format means NPF
  connection/config saving and loading is not compatible with the
  previous versions either.

Thanks to christos@ for extra testing.
2018-09-29 14:41:35 +00:00
jakllsch 3c05430e55 Revise previous to not deadlock. 2018-09-20 19:02:22 +00:00
jakllsch df54aa978e Improve support for R_AARCH64_TLSDESC relocations.
In large part from FreeBSD.
2018-09-20 18:41:05 +00:00
wiz 2aa6701c2b Remove trailing whitespace. 2018-08-24 14:24:50 +00:00
martin 48f4f2396c Bump date 2018-08-24 11:43:13 +00:00
martin bf2f242dcd Add support for remapping requested paths via a .bzredirect file.
Fixes PR 52772. Ok: mrg@
2018-08-24 11:41:16 +00:00
mrg 05225295cb fix output since protocol agnostic change went in.
XXX: i thought someone hooked this into atf already, please do :)
2018-08-24 10:04:41 +00:00
joerg da0b29937f Apply relocbase for tlsinit of the executable itself. Fixes PIE where
relocbase typically is not zero.

PR bin/53465
2018-07-24 13:48:48 +00:00
christos 8de0d28182 Initialize new_value to account for bogus return from the function. 2018-07-16 00:29:37 +00:00
gson 4828bdca7d No semicolon after macro do ... while (0) wrapper. 2018-06-23 07:21:00 +00:00
christos 64715b9aa8 We can't build those three with MKSANITIZER, they are used too early. 2018-06-09 22:41:55 +00:00
christos b5fd6cb2a8 rename flag to the official name. 2018-05-24 17:05:54 +00:00
sevan 658d9240b5 remove definition of LUA_USE_APICHECK, it is a build time option for Lua
itself. Not for modules.
2018-05-11 20:19:25 +00:00
sevan 3186d74c3d Do not try and process empty requests. This resolves a crash when issuing a
carriage return to read_request() in foreground mode.
In the C daemon, a NULL check is performed on bozo_read_request in main.c
before moving on to bozo_process_request & bozo_clean_request. Here,
process_request & clean_request just return instead.
2018-05-04 19:45:27 +00:00
christos d9ca995a53 fix the rest of the compilers. 2018-05-04 18:07:23 +00:00
christos c1e5495798 fix lint 2018-05-04 18:06:44 +00:00
sevan 89bb3c6008 Unbreak script for Lua 5.3.
This change breaks support for older releases of Lua.
2018-05-02 00:03:27 +00:00
sevan f11f7afd13 Pass the expected httpd instance when calling set_pref()
process_request() only takes a single argument.
2018-05-02 00:00:30 +00:00
sevan babdc61a7b Enable checking arguments for validity.
Remove disabled code.
Fix function parameters.
Add support for Lua 5.3
2018-05-01 23:51:53 +00:00
riastradh 7bc66ed4ff Add -f option to ftpd to stay in foreground with -D.
From nia in PR bin/53221.
2018-04-28 13:38:00 +00:00
joerg f80c3669c3 Rework ifunc support to address a number of short comings:
- Move to a shared _rtld_call_ifunc for rel and rela architectures
- Architectures using rel format must patch IRELATIVE non-PLT
  relocations like RELATIVE in additition to the later ifunc handling
- Consistently record the delta to the end of the relocation group for
  non-PLT IRELATIVE relocations

Hidden ifunc is now supported on all ifunc platforms, even when using
-fno-plt. The combination of -fno-plt and relro is broken due to
incorrect GNU ld output though.
2018-04-03 21:10:27 +00:00
joerg 2d65afd272 Move the complex logic for dynamically writing branches from ld.elf_so
into a header for reuse in crt0.o for static ifunc support. Change the
existing logic for sparc64 to use the Bicc variant of ba,a as it allows
+-8MB displacement compared to the BPcc variant's +-1MB. Teach the sparc
variant the same trick for using ba,a and not sethi+jmp when possible.
2018-03-29 13:23:39 +00:00
joerg 033ffc4d89 Don't skip PLT processing for the main binary. It can still contain
ifunc references.
2018-03-25 18:56:01 +00:00
joerg 64156cbaf3 Like Sparc, PowerPC can use IRELATIVE relocations in non-PLT sections. 2018-03-09 20:19:11 +00:00
snj cb9b4ba530 delete now-irrelevant comment 2018-03-01 06:24:12 +00:00
snj 51521ab7d9 prune disabled XIDLE support. the required X server extension hasn't been
around for a couple decades now. even if someone wanted to modernize this,
it wouldn't be appropriate for NetBSD, since we don't want programs in base
to be linked against X libs.
2018-02-28 23:45:56 +00:00
mrg 2e19323388 add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk.  use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.
2018-02-25 00:16:48 +00:00
jakllsch db546b38aa Wrap PowerPC #pragma goop in #if __GNUC_PREREQ__(6,0).
Our older GCC warns/errors on it.
2018-02-11 18:58:44 +00:00
christos 63224f5106 We need authentication || encryption even when we are not building
kerberos. They are needed for telnet_net_write() which is used in libtelnet.
2018-02-10 19:34:34 +00:00
mrg 1bf47496e9 update for GCC 6:
ignore -Wframe-address warnings for the ppc hack.
2018-02-07 06:17:45 +00:00
christos 5f8b254caf - need string.h
- cast options to long for OpenSSL-1.1
2018-02-06 15:48:46 +00:00
skrll e958e889a2 Various fixes / changes from Ryo Shimizu / Toru Nishimura to make this
work.

_rtld_call_ifunc copied from other rela platforms by me - not tested in
any way.
2018-02-04 21:49:51 +00:00
mrg 845c916a36 updates for GCC 6.4:
identd has aliasing violations, use -fno-strict-aliasing.

newfs_msdos's getbpbinfo() has missing {} issues.

sysctl's kern_cp_id() has missing {} issues.
2018-02-04 09:03:23 +00:00
maya 501cede865 Use a protocol-agnostic URL (don't degrade HTTPS->HTTP)
Suggested by Travis Paul in PR bin/52958.
2018-01-28 13:37:39 +00:00
christos 381da60e92 don't forget to eat the high bits. 2018-01-19 23:17:41 +00:00
joerg e5e34a6c86 Since GNU ld doesn't honor the PLT entry reservation, also compensate
for JMP_IREL relocations at the start of the PLT.
2017-12-25 17:00:15 +00:00
maya 0a4e3118cb Fix typo in comment
from freebsd
2017-12-25 05:29:27 +00:00
maya 6f158d565c fix debug build 2017-12-24 01:22:16 +00:00
wiz ffa84063eb Document script handler issues with httpd(8).
From martin@, addressing PR 52194.

While here, use American spelling consistently and upper-case some
abbreviations.

Bump date.
2017-11-28 12:22:27 +00:00
martin e9e7c8e344 PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.
2017-11-28 10:33:51 +00:00
joerg da03f1ef14 init/fini for the main program is handled by crt0.o, so ifunc handling
is skipped right now as it iterates the same list. Don't repeat that
mistake and explicitly take care of it in the dynamic linker.
2017-11-06 21:16:03 +00:00
ryo 9f03e9b6d3 fix to compile without USE_PAM. (unused variables) 2017-10-07 19:23:02 +00:00
mrg 803cb099d6 s/u_int/unsigned/.
from Jan Danielsson.  increases/fixes portability.
2017-10-05 04:22:41 +00:00
christos e771911261 make this compile. 2017-10-02 22:14:32 +00:00
joerg 42f0ecedd8 Include time.h for time.
XXX Doesn't build with newer zlib, remove?
2017-10-02 22:04:51 +00:00
nisimura dfab1def86 explain AARCH64 PLT design 2017-08-28 06:59:25 +00:00
nisimura 695ffc63ca - avoid caddr_t. use Elf_Addr instead.
- iron out rdbg() errors.
2017-08-23 09:17:48 +00:00
joerg 610e531ea3 Add sparc/sparc64 support for irelative relocations. 2017-08-12 09:03:27 +00:00
joerg e78cfb8eb8 Add IRELATIVE support for ARM, X86 and PowerPC. 2017-08-10 19:03:25 +00:00
joerg 493a7561e4 If a DF_1_NODELETE DSO has been removed from the DAG list, it still
needs to be able to resolve relocations against itself. As such, search
the referencing object explicitly last, if it hasn't been searched
before.
2017-08-09 18:44:32 +00:00
martin 806d1922a8 Fix thinko in previous: even if the address is an unsigned value and we
have verified the range before, we still need to mask the bit pattern
to the target instruction field.
2017-07-24 08:08:34 +00:00
martin 41cf8822e9 Simplify and fix the offset calculation when doing a %pc relative
branch from the PLT slot to the target.
2017-07-23 14:37:51 +00:00
joerg bde7a58ae6 Fix two bugs related to promotion of DSO TLS blocks into the static
thread allocation:
(1) Set the DTV vector up whenever an offset into the static allocation
is assigned, even if the block itself is not initialized. This has been
seen in libstdc++.
(2) Do not free a DTV block if it is part of the static thread
allocation.
2017-07-13 14:10:38 +00:00
christos 97c79d531d rename the macro 2017-07-12 17:55:24 +00:00
christos 15e7a34b21 make this compile with debug again (symnum uninitialized) 2017-07-12 17:54:23 +00:00
joerg e5678be828 Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.

Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.
2017-07-11 15:21:31 +00:00
joerg 88b397335b Drop comments about symbol exporting, the relevant code is gone. 2017-07-09 17:57:59 +00:00
mrg 68bd8b44d6 fix ordering of a couple of words. from Edgar Pettijohn in PR#52375.
thanks!
2017-07-07 07:05:49 +00:00
wiz d2c81abc95 Add EXIT STATUS section. Use Ex. 2017-07-04 06:56:50 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
joerg a7f7db4a1a Remove old assert that only two segments exist. The rest of the code has
been changed to cope with more and at least Go actively creates them.
Adjust the mapping size computation to use the maximum and not depend on
PT_LOAD segments to be in order.
2017-06-23 15:29:21 +00:00