blob: c38fb10078d3ed219128d6658f1c5ef98bf20f17 [file] [log] [blame]
#!/bin/sh
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This files wraps ld and ld.gold.
# In addition, it inserts hardened flags (-z now and -z relro) to the linker
# before invoking it. It also adds --hash-style=gnu to the linker command line.
#
# There is a similar wrapper around gcc that adds -fPIE, -fstack-protector-all,
# -D_FORTIFY_SOURCE=2 and -pie to the compile command line.
exec "$(readlink -f "${0}").real" -z now -z relro --hash-style=gnu "$@"