This is the mail archive of the binutils@sourceware.org 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: [PATCH] gold: Ignore definition from a dynamic object for __start/__stop


On Fri, Oct 20, 2017 at 11:11 AM, Cary Coutant <ccoutant@gmail.com> wrote:
>>> I think the must_be_in_reg flag is unnecessary -- only_if_ref should
>>> be sufficient. I looked through all the symbols that are created with
>>
>> As Alan mentioned, __start and __stop symbols must be exported,
>> but not preempted.  STV_PROTECTED should be used.
>>
>>> only_if_ref true, and they all look like they should ignore
>>> definitions (and references) in dynamic objects:
>>>
>>>   __rel_iplt_start (global hidden)
>>>   __rel_iplt_end (global hidden)
>>>  __exidx_start (arm, global hidden)
>>>   __exidx_end (arm, global hidden)
>>>   _TLS_MODULE_BASE_ (local hidden)
>>>   __preinit_array_start (global hidden)
>>>   __preinit_array_end (global hidden)
>>>   __init_array_start (global hidden)
>>>   __init_array_end (global hidden)
>>>   __fini_array_start (global hidden)
>>>   __fini_array_end (global hidden)
>>>   __stack (global default)
>>>   __executable_start (global default)
>>>   __ehdr_start (global hidden)
>>>   etext, _etext, __etext (global default)
>>>   edata (global default)
>>>   end (global default)
>>>
>>> Certainly the ones that are hidden should ignore both defs and refs in
>>> dynamic objects. The others (__stack, __executable_start, [_][_]etext,
>>> edata, and end) should at least ignore defs in dynamic objects.
>
> You didn't answer why you think it's not reasonable to use only_if_ref
> by itself, rather than adding the new must_be_in_reg flag.
>

only_if_ref isn't sufficient.  Passing visibility to define_special_symbol
may work.  If visibility != STV_DEFAULT, both refs and defs in dynamic
objects can be ignored.  If visibility == STV_DEFAULT, defs in dynamic
objects can be ignored.


-- 
H.J.


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