This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Define __start/__stop symbols when there is only a dynamic def
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Alan Modra <amodra at gmail dot com>, Binutils <binutils at sourceware dot org>, Michael Matz <matz at suse dot de>
- Date: Fri, 26 Jan 2018 08:52:42 -0800
- Subject: Re: Define __start/__stop symbols when there is only a dynamic def
- Authentication-results: sourceware.org; auth=none
- References: <20180126052959.GB20622@bubble.grove.modra.org> <d7e54f35-6f60-cc7c-4f21-23bff5de73a0@redhat.com> <CAMe9rOqVQnaJU4xKfRxPiO9yMADw99BJXZSwRZma=e2F8gX8zg@mail.gmail.com> <CAMe9rOp0xkLM4UKR=x78GVSHrvKQfvqw2WesrxNRteS84H_nZQ@mail.gmail.com>
On Fri, Jan 26, 2018 at 6:04 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Jan 26, 2018 at 5:43 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Jan 26, 2018 at 5:19 AM, Nick Clifton <nickc@redhat.com> wrote:
>>> Hi Alan,
>>>
>>>> This patch fixes a case where a user had a C-representable named
>>>> section in both the executable and shared libraries, and of course
>>>> wanted the size of the local section in the executable, not the
>>>> dynamic section. It does mean that __start and __stop symbols don't
>>>> behave exactly like PROVIDEd symbols, but I think that's a reasonable
>>>> difference particularly since this is the way they used to behave.
>>>
>>> Is this distinction now documented ? Ie can future users still be
>>> confused by this behaviour ?
>>>
>>>> Nick, I'd like to apply this to the branch. I think it should be
>>>> quite safe.
>>>>
>>>> * elflink.c (bfd_elf_define_start_stop): Override symbols when
>>>> they are defined dynamically.
>>>
>>> Fair enough - please apply - although I do also like H.J.'s request
>>> for a testcase...
>>>
>>
>> There are testcases for:
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=21964
>>
>> But they only check __start/__stop symbols are handled correctly.
>> __size isn't checked. Let me see if I can extend them to check
>> __size.
>
> It should be the ".sizeof." directive. One thing which bothers me is
> why __start/__stop are OK without the patch. Why is it needed only
> for ".sizeof." I will find it out with the new testcase for ".sizeof.".
>
Something wrong with the ".sizeof." directive. I opened a bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=22750
--
H.J.