Commit Graph

3124 Commits

Author SHA1 Message Date
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
joerg 3870ab1fa7 Replace last use of r_type. 2017-06-21 12:34:01 +00:00
joerg 152a0d21c4 Add back symnum, fix debug print. 2017-06-20 15:02:54 +00:00
joerg ddeaaf811f Add last_symnum, move up def and defobj. 2017-06-20 13:45:20 +00:00
joerg d5127e3ef7 Fix C&P bug. Deal with more MIPS hacks overriding def. 2017-06-20 13:24:03 +00:00
joerg 6d0511e34f Expand symnum, GCC's uninitialized used tracking is too imprecise. 2017-06-20 12:41:49 +00:00
joerg fd7c99c412 Drop symbol number from default branch diagnostic, it isn't set at this
point and most likely not valid either.
2017-06-20 11:01:18 +00:00
joerg e45d4ba084 Replace COMBREL with just-in-time check in _rtld_relocate_nonplt_objects.
The COMBREL logic predates thread-safety of the dynamic linker and
breaks the use of shared locks for the common symbol lookup case. It is
unlikely to provide any benefit for lazy binding or PLT lookups, so
provide equivalent functionality in the non-PLT relocation handling loop
by checking if the symbol used by the current relocation is the same as
the one used during the last lookup. No inter-object cachine is done as
it is also unlikely to be benefical.

Testing with Firefox startup on AMD64 shows a small performance gain by
the new method.
2017-06-19 11:57:01 +00:00
joerg 28b12dab1c Fix indentation. 2017-06-15 23:08:46 +00:00
joerg 130ea7cf18 Call _rtld_debug_state before running the global initialisers, so give
gdb a chance to set break points etc.
2017-06-08 18:24:39 +00:00
alnsn 9a921db489 Cosmetic changes to Lua binding in bozohttpd.
- Don't use negative indicies to read arguments of Lua functions.
- On error, return nil, "error string".
- Use ssize_t for return values from bozo_read() and bozo_write().
- Prefer lstring especially when if saves you from appending NUL and
  doing len + 1 which can potentially wraparound.
- Don't mix C allocations with Lua functions marked with "m" in the Lua
  manual. Those functions may throw (longjump) and leak data allocated
  by C function. In one case, I use luaL_Buffer, in the other case,
  I rearranged calls a bit.
2017-05-28 22:37:36 +00:00
riastradh ef315f7931 Remove MKCRYPTO option.
Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export.  The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated.  I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S.  Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet...  That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.
2017-05-21 15:28:36 +00:00
uwe 672fc2f785 PR port-macppc/47464 - Old binutils generated bogus zero-sized COPY
relocations for _SDA_BASE_ and _SDA2_BASE_ that happened to work by
accident.  They no longer happen to work when old binaries are run on
newer systems.  Explicitly ignore these bogus relocations.
2017-04-27 08:37:15 +00:00
maya cfef4500d4 Revert to version 1.55 of map_object.c. This reverts:
"really unmap the gap between the text and data rather than just removing
all access with mprotect().  the latter results in the kernel having to
keep track of that range separately since the permissions are different.
avoid calling mmap() with a size of zero."

As per toolchain/52054: src/libexec/ld.elf_so update breaks everything,
this commit is very broken for some people (but not others). chs mentioned
he has a fix, but best not to leave -current broken in the meantime.
2017-03-10 09:13:49 +00:00