[PATCH] gold: Ignore definition from a dynamic object for __start/__stop

Alan Modra amodra@gmail.com
Fri Oct 20 01:06:00 GMT 2017


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



More information about the Binutils mailing list