Import CVS version of mandoc as of 20141201
libelf: Fix cross-endian ELF note file / memory conversion

The namesz and descsz variables need to be used in native endianness.
The sizes are in native order after swapping in the file to memory case,
and before swapping in the memory to file case.

This issue was identified for r273443, but the change was applied to the
wrong case. Revert r273443 to fix the to-memory case, and apply the
equivalent change to the to-file case.

Sponsored by:	DARPA, AFRL
Reviewed by:	adrian, brooks, marcel
Differential Revision: https://reviews.freebsd.org/D1257
Revert r275136, it was not approved, it was sloppy, if a feature
like this is needed please resubmit for Intel's approval.
Update to mandoc cvs version as of 20141201
- Compatiblity with existing manpages has been improved
- Now support ".so" directive with compressed manpages (which fixes a regression
we have since we have new man(1))
Revert r274953, r274934

mandoc(1) is now able to display correctly the vanilla version
Remove unused PCMCIA_CARD* macros.

Always include the card human readable name. We support ~270 cards and
at ~20 bytes each, this bloats things by only ~5k. Retain the
PCMCIA_CARD vs PCMCIA_CARD_D distinction, though, in case this is
intolerable.
Add sleep(1) to /rescue.  This adds 664 bytes to the binary on amd64 but
it's pretty useful for shell scripts.

MFC after:	1 month
Sponsored by:	iXsystems, Inc.
Switch gpioctl(8) to LIBADD.
ANSIfy function declarations.

Sponsored by:	Yandex LLC
Remove __P() macro.

Suggested by:	kevlo
Sponsored by:	Yandex LLC
Plug memory leaks on UNMAP and XCOPY with invalid parameters.

MFC after:	1 week
Do not pre-allocate reservation keys memory for every possible initiator.

In configurations with many ports, like iSCSI, each LUN is typically
accessed only by limited subset of ports.  Allocating that memory on
demand allows to reduce CTL memory usage from 5.3MB/LUN to 1.3MB/LUN.

MFC after:	1 month
Do not corrupt the listen string when parsing it.

This fixes problem with ctld reload when it is configured to listen on two
portals with same IP, but different ports.

MFC after:	1 week
Remove some unused code.
Increase BERI loader section alignment to 16

The .text, .bss, and .data sections claimed 16-byte alignment, but were
only aligned to 8 by the linker script.

Discovered with strip(1) from elftoolchain, which performs validation
absent from the binutils strip(1).

Sponsored by:	DARPA, AFRL
Do not pre-allocate UNIT ATTENTIONs storage for every possible initiator.

Abusing ability of major UAs cover minor ones we may not account UAs for
inactive ports.  Allocate UAs storage for port and start accounting only
after some initiator from that port fetched its first POWER ON OCCURRED.

This reduces per-LUN CTL memory usage from >1MB to less then 100K.

MFC after:	1 month
Unify function names after r275458.

MFC after:	1 month
Revert device_getenv_int() for now as it duplicates resource_int_value().
We should perhaps implement a device_getenv_*() and device_setenv_*() API
as a convenience wrapper on top of resource_*_value() and resource_set_*().
Increase CTL ports limit from 128 to 256 and LUNs limit from 256 to 1024.

After recent optimizations this change is no longer blocked by CTL memory
consumption.  Those limits are still not free, but much cheaper now.

MFC after:	1 week
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
Assign argemdio0 to the correct base address and assign argemdio1 to its
proper place *after* argemdio0

Correctly place arge0 and arge1 on their respective bus positions.

Sponsored by:	Nicholas Esborn <nick@desert.net>