This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld: enable new dtags by default for linux/gnu targets
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: binutils at sourceware dot org
- Date: Mon, 4 Feb 2013 10:14:25 -0800
- Subject: Re: [PATCH] ld: enable new dtags by default for linux/gnu targets
- References: <1356420600-11507-1-git-send-email-vapier@gentoo.org> <1358543188-21235-1-git-send-email-vapier@gentoo.org>
On Fri, Jan 18, 2013 at 1:06 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> The "new" dtags options have been around for 14+ years now, so for Linux
> and GNU targets, enable them by default.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> 2012-01-18 Mike Frysinger <vapier@gentoo.org>
>
> * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
> link_info.new_dtags to TRUE for linux/gnu targets.
> * NEWS: Mention new dtags default.
> ---
> ld/NEWS | 2 ++
> ld/emultempl/elf32.em | 10 ++++++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/ld/NEWS b/ld/NEWS
> index 1e07605..6b30b2f 100644
> --- a/ld/NEWS
> +++ b/ld/NEWS
> @@ -4,6 +4,8 @@
>
> * --enable-new-dtags no longer generates old dtags in addition to new dtags.
>
> +* For Linux/GNU targets, new dtags is now the default.
> +
> Changes in 2.23:
>
> * Enable compressed debug section feature for x86/x86_64 pe-coff.
> diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
> index 53d4e24..60611f9 100644
> --- a/ld/emultempl/elf32.em
> +++ b/ld/emultempl/elf32.em
> @@ -105,6 +105,16 @@ gld${EMULATION_NAME}_before_parse (void)
> input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
> config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
> config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
> +EOF
> +
> +case ${target} in
> + *-*-linux-* | *-*-k*bsd*-* | *-*-gnu*)
> + fragment <<EOF
> + link_info.new_dtags = TRUE;
> +EOF
> + ;;
> +esac
> +fragment <<EOF
> }
>
> EOF
> --
> 1.8.0.2
>
This breaks -rpath on Linux:
http://sourceware.org/bugzilla/show_bug.cgi?id=15096
Since DT_RPATH != DT_RUNPATH, we shouldn't generate
DT_RPATH for -rpath.
--
H.J.