This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch RFC] implement suppotr for -z origin
- From: Ian Lance Taylor <iant at google dot com>
- To: "Chris Demetriou" <cgd at google dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 11 Sep 2008 22:31:04 -0700
- Subject: Re: [gold patch RFC] implement suppotr for -z origin
- References: <2e7be40c0809112214y44c4b37ey4b025d0b1f4592c@mail.gmail.com>
"Chris Demetriou" <cgd@google.com> writes:
> 2008-09-11 Chris Demetriou <cgd@google.com>
>
> * options.h (origin): New -z option.
> * layout.cc (Layout:finish_dynamic_section): If "-z origin"
> is specified set DF_1_ORIGIN in DT_FLAGS_1, and if
> --enable-new-dtags was also specified set DF_ORIGIN in DT_FLAGS.
> Index: layout.cc
> ===================================================================
> RCS file: /cvs/src/src/gold/layout.cc,v
> retrieving revision 1.112
> diff -u -u -p -r1.112 layout.cc
> --- layout.cc 13 Aug 2008 07:37:46 -0000 1.112
> +++ layout.cc 12 Sep 2008 05:02:04 -0000
> @@ -2753,6 +2753,9 @@ Layout::finish_dynamic_section(const Inp
> }
> if (parameters->options().shared() && this->has_static_tls())
> flags |= elfcpp::DF_STATIC_TLS;
> + if (parameters->options().origin()
> + && parameters->options().enable_new_dtags())
> + flags |= elfcpp::DF_ORIGIN;
> odyn->add_constant(elfcpp::DT_FLAGS, flags);
Don't check enable_new_dtags. That only controls whether gold emits
DT_RUNPATH as well as DT_RPATH. The name is terrible, but it came
from GNU ld. It's true that GNU ld uses --enable-new-dtags to control
whether to emit some other flags, but that really makes no sense.
OK with that change.
Thanks.
Ian