Split the symlook_obj1 into a loop iterating over the ELF object symbol
hash elements, and a helper matched_symbol() which match the given hash
entry and request, performing needed type and version checks.

Based on dragonflybsd support for GNU hash by John Marino <draco marino st>
Reviewed by:	kan
Tested by:	bapt
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234840 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add GNU hash support for rtld.

Based on dragonflybsd support for GNU hash by John Marino <draco marino st>
Reviewed by:	kan
Tested by:	bapt
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234841 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improve growfs(8) in a few ways; unfortunately, it's somewhat hard to untangle
them and commit separately.

1. Rewrite the way growfs(8) finds the device and mount point.  This makes
   it possible to use e.g. "growfs /mnt"; it's also used to display more
   helpful messages.

2. Be more user-friendly, using descriptive messages, like this:

   OK to grow filesystem on /dev/md0, mounted on /mnt, from 9.8GB to 20GB? [Yes/No]"

3. Allow to specify the size (-s option) just like with mdconfig(8), i.e. with
   postfixes ("mdconfig -s 10g").

4. Reload read-only filesystem after growing.

Reviewed by:	kib, mckusick (earlier version)
Sponsored by:	The FreeBSD Foundation


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234846 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add myself.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234847 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add to GEOM RAID class module, supporting the DDF metadata format, as
defined by the SNIA Common RAID Disk Data Format Specification v2.0.

Supports multiple volumes per array and multiple partitions per disk.
Supports standard big-endian and Adaptec's little-endian byte ordering.
Supports all single-layer RAID levels. Dual-layer RAID levels except
RAID10 are not supported now because of GEOM RAID design limitations.

Some work is still to be done, but the present code already manages basic
interoperation with RAID BIOS of the Adaptec 1430SA SATA RAID controller.

MFC after:	1 month
Sponsored by:	iXsystems, Inc.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234848 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Respect mathematical operation order piority with the exponent gnu extension

Obtained from:	OpenBSD
Approved by:	des (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234850 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add two special directives to libmap.conf:
include <file>:
  Parse the contents of file before continuing with the current file.
includedir <dir>:
  Parse the contents of every file in dir that ends in .conf before continuing
  with the current file.
Any file or directory encountered while processing include or includedir
directives will be parsed exactly once, even if it is encountered multiple
times.

Reviewed by:	kib, des
Approved by:	des (mentor)
MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234851 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Import m4 regression tests from OpenBSD

Obtained from:	OpenBSD
Approved by:	des (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234852 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Unbreak jemalloc build with MALLOC_PRODUCTION set. New jemalloc version
uncovered MIPS-related gcc bug described in
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33256

The patch was obtained from r128198 in gcc-4_1-branch, which is GPLv2,
so it's OK to merge it.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234855 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
GNU/kFreeBSD portability fix. This glue <stdlib.h> overrides header protection
in the system-wide version of <stdlib.h> by wrapping the #include_next
<stdlib.h> within the scope of its own header protection. On FreeBSD this has
no effect, since both header protections are equivalent. However the GNU version
of <stdlib.h> implements a special header protection mechanism which allows it
to be included multiple times (in different modes).

Simply by moving the #include_next off the header protection, we allow
system-wide <stdlib.h> to implement its own protection policy, whichever that
may be.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234856 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add myself to this file - it didn't exist last time.

Approved by:	rmacklem (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234857 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Migrate ARGE_DEBUG to opt_arge.h.

Submitted by:	Stefan Bethke <stb@lassitu.de>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234859 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Teach ubldr(8) about simple MBR partitioning.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234860 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bring over the first part of the etherswitch framework - an MDIO bus and
MDIO/MII rendezvous proxy.

* Add an 'mdio' bus, which is the "IO" side of an MII bus (but by design
  can be anything which implements the underlying register access API.)
* Add 'miiproxy' and 'mdioproxy', which provides a rendezvous mechanism
  for MII busses to appear hanging off arbitrary busses (ie, that aren't
  necessarily a traditional looking MII bus.)

MII busses can now hang off anything that implements an mdiobus.

For the AR71xx SoC, there's one MDIO bus but two MII busses.  So to
properly support two or more real PHYs, this can be done:

  # arge0 MDIO bus - there's no arge1 MDIO bus for AR71xx
  hint.argemdio.0.at="nexus0"
  hint.argemdio.0.maddr=0x19000000
  hint.argemdio.0.msize=0x1000
  hint.argemdio.0.order=0

  # Create two mdioproxy instances
  hint.mdioproxy.0.at="mdio0"
  hint.mdioproxy.1.at="mdio0"

  # .. and with a follow-up patch
  hint.arge.0.mdio=mdioproxy0
  hint.arge.1.mdio=mdioproxy0

TODO:

* Do a sweep or two and add appropriate locking in mdio/mdioproxy/miiproxy.

Submitted by:	Stefan Bethke <stb@lassitu.de>
Reviewed by:	ray


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234861 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Break out the arge MDIO bus code into an optional argemdio device.

This is only done if the ARGE_MDIO option is included.

* Shuffle the arge MDIO bus into a separate device, that needs to be
  probed early (use hint.argemdio.X.order=0)
* hint.arge.X.mdio now specifies which miiproxy to rendezvous with.
* Call MAC/MDIO bus init during MDIO attach, not arge attach.

This is done regardless:

* Shift the arge MAC and MDIO bus reset code into separate functions
  and call it early during MDIO bus attach.  It's required for
  correct MDIO bus IO to occur on AR71xx/AR91xx devices.

* Remove the AR71xx/AR91xx centric assumption that there's only one
  MDIO bus.  The initial code mapped miibus0(arge0) and miibus1(arge1)
  MII register operations to the MII0 (arge0) register space.  The
  AR724x (and later, upcoming chipsets) have two MDIO busses and
  the second is very much in use.

TODO:

* since the multiphy behaviour has changed (where now a phymask of >1
  PHY will still be enumerated), multiphy setups may be quite wrong.
  I'll go and fix these so they still have a chance of working, at least.
  until the switch PHY support appears in -HEAD.

Submitted by:	Stefan Bethke <stb@lassitu.de>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234862 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Convert AP96 to use the mdioproxy and ARGE_MDIO option.

arge1 still works (it's the standalone PHY) but arge0 and the other switch
ports don't work.  They're enumerated though, demonstrating that the
mdiobus abstraction is correctly working.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234863 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix make depend.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- fixed a vnode lock hang-up issue.
- fixed an incorrect lock status issue.
- fixed an incorrect lock issue of unionfs root vnode removed.
  (pointed out by keith)
- fixed an infinity loop issue.
  (pointed out by dumbbell)
- changed to do LK_RELEASE expressly when unlocked.

Submitted by:	ozawa@ongs.co.jp


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234867 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improve DDF metadata writing.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234868 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement volume deletion if disk has more then one partition.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@234869 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f