[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.

Shankar Kalpathi Easwaran shankarke at gmail.com
Tue Aug 5 16:42:38 PDT 2014


IMO

- We should not be adding dynamicExport() to the Atom, as its not a property of the Atom.
- We should not add a new Resolver.

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.

d) The ELF writer would go through all the atoms that have been set dynamicExportAsNeeded and create dynsym entries.

With this change, there is no change needed in the Resolver and there is no need of a ELFResolver.

http://reviews.llvm.org/D4789






More information about the llvm-commits mailing list