freebsd-dev/contrib
Dimitry Andric 69660011c6 Revert r357259, after the merge from head which added linker scripts for
stand/i386 boot:

Revert upstream lld r371957 (git commit 06bb7dfbd) by Fangrui Song:

  [ELF] Map the ELF header at imageBase

  If there is no readonly section, we map:

  * The ELF header at imageBase+maxPageSize
  * Program headers at imageBase+maxPageSize+sizeof(Ehdr)
  * The first section .text at imageBase+maxPageSize+sizeof(Ehdr)+sizeof(program headers)

  Due to the interaction between Writer<ELFT>::fixSectionAlignments and
  LinkerScript::allocateHeaders,
  `alignDown(p_vaddr(R PT_LOAD)) = alignDown(p_vaddr(RX PT_LOAD))`.
  The RX PT_LOAD will override the R PT_LOAD at runtime, which is not ideal:

  ```
  // PHDR at 0x401034, should be 0x400034
    PHDR           0x000034 0x00401034 0x00401034 0x000a0 0x000a0 R   0x4
  // R PT_LOAD contains just Ehdr and program headers.
  // At 0x401000, should be 0x400000
    LOAD           0x000000 0x00401000 0x00401000 0x000d4 0x000d4 R   0x1000
    LOAD           0x0000d4 0x004010d4 0x004010d4 0x00001 0x00001 R E 0x1000
  ```

  * createPhdrs allocates the headers to the R PT_LOAD.
  * fixSectionAlignments assigns `imageBase+maxPageSize+sizeof(Ehdr)+sizeof(program headers)` (formula: `alignTo(dot, maxPageSize) + dot % config->maxPageSize`) to addrExpr of .text
  * allocateHeaders computes the minimum address among SHF_ALLOC sections, i.e. addr(.text)
  * allocateHeaders sets address of ELF header to `addr(.text)-sizeof(Ehdr)-sizeof(program headers) = imageBase+maxPageSize`

  The main observation is that when the SECTIONS command is not used, we
  don't have to call allocateHeaders. This requires an assumption that
  the presence of PT_PHDR and addresses of headers can be decided
  regardless of address information.

  This may seem natural because dot is not manipulated by a linker script.
  The other thing is that we have to drop the special rule for -T<section>
  in `getInitialDot`. If -Ttext is smaller than the image base, the headers
  will not be allocated with the old behavior (allocateHeaders is called)
  but always allocated with the new behavior.

  The behavior change is not a problem. Whether and where headers are
  allocated can vary among linkers, or ld.bfd across different versions
  (--enable-separate-code or not). It is thus advised to use a linker
  script with the PHDRS command to have a consistent behavior across
  linkers. If PT_PHDR is needed, an explicit --image-base can be a simpler
  alternative.

  Differential Revision: https://reviews.llvm.org/D67325

  llvm-svn: 371957
2020-03-05 18:09:19 +00:00
..
amd amd: add deprecation warning on program startup 2019-11-22 15:06:07 +00:00
apr contrib/apr: Rip out bogus [CS]PRNG implementation 2020-01-30 18:12:41 +00:00
apr-util
atf
bearssl Add libbearssl 2019-02-26 05:59:22 +00:00
binutils Fix the following -Werror warning from clang 10.0.0 in binutils: 2020-01-28 20:09:23 +00:00
blacklist blacklistd.conf.5: pluralization correction 2019-11-06 17:01:35 +00:00
bmake retire the LLVM_LIBUNWIND option 2020-02-29 12:43:43 +00:00
bsnmp bsnmpd(1): Replace dubious srandomdev+random(3) with arc4random(3) 2019-12-13 05:13:25 +00:00
byacc
bzip2 Upgrade to Bzip2 version 1.0.8. 2019-08-11 06:26:03 +00:00
capsicum-test Really skip the tests in capsicum tests 2020-02-17 20:25:33 +00:00
com_err
cortex-strings
dialog Update libdialog to 1.3-20180621 2018-10-20 20:49:46 +00:00
diff
dma Make dma(8) buildable. 2018-09-19 06:42:05 +00:00
ee
elftoolchain readelf: simplify namesz / descsz checks 2020-03-04 20:41:45 +00:00
expat MFV r355071: libbsdxml (expat) 2.2.9. 2019-11-25 07:48:16 +00:00
file MFV r357712: file 5.38. 2020-02-11 07:02:48 +00:00
flex
gdb [PPC64] Fix GDB sigtramp detection 2019-11-01 11:28:43 +00:00
gdtoa
googletest googletest: pick from upstream: Don't allow signed/unsigned wchar_t in gcc 9 and later 2019-12-21 02:44:50 +00:00
hyperv/tools
ipfilter As with ipf(8), give ippool(8) the ability to load IP pools from multiple 2020-02-18 11:26:49 +00:00
jemalloc jemalloc: pick from upstream: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC 2019-12-21 02:44:38 +00:00
ldns Regenerate: remove GOST, enable DANE-TA now that we have OpenSSL 1.1.1. 2018-10-11 08:14:31 +00:00
ldns-host
less MFV r349535: less v551. 2019-06-29 18:41:40 +00:00
libarchive MFV r358511,r358532: 2020-03-02 08:44:58 +00:00
libbegemot
libc-pwcache
libc-vis
libcxxrt Include <stdint.h> in unwind-arm.h, since it uses uint32_t and uint64_t 2019-09-13 21:00:19 +00:00
libdivsufsort
libedit Fix arm and aarch64 builds of libedit after r352275 2019-09-14 21:49:42 +00:00
libevent libevent: eliminate in-tree usage of arc4random_addrandom 2018-09-25 17:41:48 +00:00
libexecinfo Sync up with NetBSD libexecinfo changes 2014-2019 2019-10-26 06:59:59 +00:00
libgnuregex
libpcap MFV r355890: 2019-12-21 21:05:53 +00:00
libucl
libxo Import libxo-1.4.0: 2020-01-25 21:16:45 +00:00
llvm-project Revert r357259, after the merge from head which added linker scripts for 2020-03-05 18:09:19 +00:00
lua
mandoc Update mandoc to cvs snapshot 2019-07-23 2019-07-26 10:00:33 +00:00
mknod
mtree mtree -O: Fix not descending on hash collisions 2019-09-12 20:46:46 +00:00
ncurses Update to 6.2-20200215 2020-02-19 17:09:08 +00:00
netbsd-tests MFV r357687: Import NFS fix for O_SEARCH tests 2020-02-09 04:05:30 +00:00
netcat Add -M option to nc(1), which makes it print the TCP connection 2019-12-14 10:53:52 +00:00
ngatm
ntp MFV r358616: 2020-03-04 21:45:12 +00:00
nvi vi.1: Fix a typo 2019-12-09 17:58:22 +00:00
ofed Add ConnectX-6 DX HCA ID to libmlx5. 2019-05-08 11:04:09 +00:00
one-true-awk Another partial revert of r301289. 2019-06-03 05:25:22 +00:00
openbsm auditd(8): fix long-standing uninitialized memory use bug 2019-11-28 00:46:03 +00:00
opencsd/decoder Remove a stale file left after merging. 2019-10-10 13:44:12 +00:00
openpam Upgrade to OpenPAM Tabebuia. 2019-02-25 18:41:16 +00:00
openresolv MFV 354917, 354918, 354919 2019-11-20 23:56:20 +00:00
opie
pam_modules/pam_passwdqc
pf
pjdfstest
pnpinfo
processor-trace Update Intel Processor Trace decoder library. 2019-10-10 12:46:34 +00:00
sendmail Plug possible memory leaks in the previous patch. 2020-02-27 23:06:12 +00:00
serf MFV r339226 (peter): Record merge of serf-1.3.9. 2018-10-08 15:16:04 +00:00
smbfs mount_smbfs: Issue a warning when .nsmbrc section name contains lowercase characters. 2020-01-03 12:54:14 +00:00
sqlite3 Revert r357201: downgrade sqlite3 from sqlite3-3.31.0 (3310000) to 2020-02-04 19:45:51 +00:00
subversion
tcp_wrappers Remove a duplicate global (rfc931_timeout). 2019-07-17 23:43:14 +00:00
tcpdump MFV r353143 (phillip): 2019-12-21 21:02:50 +00:00
tcsh Update tcsh to git revision 83c5be0 bringing in a number of bug fixes. 2019-10-21 21:21:34 +00:00
telnet libtelnet: Replace bogus use of srandomdev + random to generate "public key pair" 2019-12-13 05:42:57 +00:00
tnftp Fix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF. 2020-02-27 19:49:59 +00:00
traceroute The variable names in the description of the port number usage is 2019-06-20 12:38:41 +00:00
tzcode Remove no longer relevant comment, as suggested by imp@. 2018-10-30 15:44:16 +00:00
tzdata Import tzdata 2019c 2019-09-12 00:19:16 +00:00
unbound Unbound's config.h is manually maintained, using a ./configure produced 2020-01-13 06:55:31 +00:00
unvis
vis
wpa MFV r346563: 2019-08-22 18:52:30 +00:00
xz MFV r357608: Limit memory usage in xz(1) instead of in tuklib. 2020-02-06 07:47:28 +00:00