This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Define __start/__stop symbols when there is only a dynamic def


On Mon, 5 Feb 2018, Cary Coutant wrote:

> > Great.  I hope we finally nailed it :-).
> And now can we have a summary of the new rules, please? I'm afraid to
> ask what I need to change in gold.

It still might not be the final rules ;-/ We might still go away from 
protected back to global but symbolically bound symbols, for somewhat 
esoteric reasons.  (And also see one report at which has noted a 
still different use-case that worked before 2.29, gnah!).

The rules _as of right now_: if section XXX exists and XXX is a
C-representable name, then:
* if there's a regular definition of __start_XXX, do nothing
* else,
  - if  1) there's a regular reference to __start_XXX,
  - or, 2) there's a dynamic definition of __start_XXX,
  - or, 3) there's a dynamic reference to __start_XXX,
  - or, 4) you pass -u __start_XXX (which is not a regular ref),
    a) create a symbol __start_XXX with value startof(XXX).
    b) When it isn't overridden by options, make that symbol protected.
    c) Make that symbol dynamic in cases 2 and 3, otherwise make the 
       symbol dynamic only when other normal symbols would have been made 
       dynamic (creating shared lib, or -E, or other such options).

Same for __stop_XXX.  Do similar for .startof.XXX and .sizeof.XXX, except 
for not doing b) and c), these symbols are local, not dynamic.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]