This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] gold: Ignore definition from a dynamic object for __start/__stop
- From: Alan Modra <amodra at gmail dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 20 Oct 2017 11:36:12 +1030
- Subject: Re: [PATCH] gold: Ignore definition from a dynamic object for __start/__stop
- Authentication-results: sourceware.org; auth=none
- References: <20171018132021.GA4627@gmail.com> <CAJimCsEYhYtcPosB6vjsUsp02G69KKgn3MZ9=a=5XUowcx6diA@mail.gmail.com>
On Thu, Oct 19, 2017 at 05:39:32PM -0700, Cary Coutant wrote:
> > Since __start and __stop symbols must be defined in a regular object,
> > definition from a dynamic object should be ignored. Also __start and
> > __stop symbols in a dynamic object shouldn't be preempted.
> >
> > PR gold/22291
> > * layout.cc (Layout::define_section_symbols): Use STV_PROTECTED
> > and set must_be_in_reg to true for __start and __stop symbols.
>
> Shouldn't we use HIDDEN here instead of PROTECTED? If the symbols must
> be defined in a regular object, and should not be pre-empted, it seems
> to me that references to start and stop symbols should always be from
> within the same load module.
We went over this for ld.bfd
commit 487b6440dad57440939fab7afdd84a218b612796
Author: Alan Modra <amodra@gmail.com>
Date: Mon Aug 21 13:28:06 2017 +0930
Make __start/__stop symbols protected visibility
They can't be hidden visibility since apparently people use dlsym to
look them up.
--
Alan Modra
Australia Development Lab, IBM