[PATCH] [ELF] LLD does not create a record in the .dynsym if a strong symbol defined in the executable file replaces a weak symbol from a shared library.

Simon Atanasyan simon at atanasyan.com
Tue Aug 12 04:59:56 PDT 2014


On Wed, Aug 6, 2014 at 3:42 AM, Shankar Kalpathi Easwaran
<shankarke at gmail.com> wrote:
> What we could do is
>
> a) Create references dynamicExportNone, dynamicExportAsNeeded, dynamicExportAlways(For shared libraries)
>
> b) The reader would set the reference to be dynamicExportNone for all atoms that it creates,
>
> c) A new pass (DynamicSymbolTableCreate) would go through all atoms, and if has been resolved from a shared library, sets it to dynamicExportAsNeeded.

In general, it is a good idea. I see the only problem here - it is
unclear how to pass information about symbol resolution from the
Resolver class to the new DynamicSymbolTableCreate pass. Now only
Resolver knows that a weak symbol A from a shared library is coalesced
away by a strong symbol A from an executable file. When the
Resolver::resolve() method finishes this information is lost. That is
why my initial idea was to create a Resolver sub-class.

-- 
Simon Atanasyan



More information about the llvm-commits mailing list