[PATCH] ELF: Properly handle section symbols
H.J. Lu
hjl.tools@gmail.com
Wed Jun 10 12:32:11 GMT 2020
On Tue, Jun 9, 2020 at 9:42 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Tue, Jun 09, 2020 at 11:50:23AM -0700, H.J. Lu wrote:
> > When defining the section symbol, __start_FOO, for the section FOO:
> >
> > 1. Treat the common symbol, __start_FOO, in input object file as
> > definition.
> > 2. Clear verinfo.verdef.
>
> The above looks good.
>
> > 3. Make the section symbol PROTECTED only in shared library.
>
> I would be inclined to not make this change. While it is true that
> protected visibility only makes sense in a shared library, I can't see
> a compelling reason to prohibit such a symbol in an executable. I
This is a quality of implementation issue. I will create a separate patch
for it.
> made the comment in the bugzilla
> "But that leaves you with a really odd
> 5: 0000000000004010 8 OBJECT GLOBAL PROTECTED 24 __start_FOO@@SOME_VERSION_NAME
> in main."
> because it seemed to me that this symbol being dynamic in the
> executable serves no purpose. The dynamic symbol of the same name in
It is to support dlopen (section_symbol).
> libfoo.so, being protected visibility, can't be overridden by a symbol
> in the executable.
>
> Trimming off unnecessary dynamic symbols like this one is probably
> best not done just before a binutils release.
That will break some applications.
This is the patch I am checking in.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ELF-Properly-handle-section-symbols.patch
Type: text/x-patch
Size: 5351 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200610/a1c5fc6b/attachment.bin>
More information about the Binutils
mailing list