This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GOLD][PATCH] Add .{fini,init,preinit}_array and add DT_BSYMBOLIC tags as needed.
- From: Ian Lance Taylor <iant at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 15 Oct 2009 07:34:55 -0700
- Subject: Re: [GOLD][PATCH] Add .{fini,init,preinit}_array and add DT_BSYMBOLIC tags as needed.
- References: <498552560910150103i5aadcecbwec8cea38fd75a713@mail.gmail.com>
"Doug Kwan (éæå)" <dougkwan@google.com> writes:
> 2009-10-15 Doug Kwan <dougkwan@google.com>
>
> * layout.cc (Layout::finish_dynamic_section): Generate tags
> DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
> DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ and DT_BSYMBOLIC as needed.
> @@ -3186,6 +3207,8 @@ Layout::finish_dynamic_section(const Inp
> flags |= elfcpp::DF_STATIC_TLS;
> if (parameters->options().origin())
> flags |= elfcpp::DF_ORIGIN;
> + if (parameters->options().Bsymbolic())
> + flags |= elfcpp::DF_SYMBOLIC;
> if (parameters->options().now())
> flags |= elfcpp::DF_BIND_NOW;
> odyn->add_constant(elfcpp::DT_FLAGS, flags);
Besides setting DF_SYMBOLIC in flags, please also do
// Add DT_SYMBOLIC for compatibility with older loaders.
odyn->add_constant(elfcpp::DT_SYMBOLIC, 0);
as we do for DT_TEXTREL.
This is OK with that change.
Thanks.
Ian