[PATCH] [ELF] Export strong defined symbol if it coalesces away a weak symbol defined in a shared library

Rui Ueyama ruiu at google.com
Wed Sep 3 10:10:21 PDT 2014

Comment at: include/lld/Core/Reference.h:97
@@ -96,1 +96,3 @@
+    // kindDynExport marks an ELF atom which needs to be dynamically exported.
+    kindDynExport = 6,
I think I don't like this pattern that uses a reference as a boolean attribute for an atom. I understand it's undeniably convenient in some cases, in particular when storing and restoring an atom with the attribute to/from disk using native/yaml format, but it is basically simulating a C++ member in a complicated manner using its own associative list. There is also a performance concern because in order to access the "field" we have to iterate over the reference list.

This can be a boolean field in the ELF class, can't this?

If the reason not to make it a member is native/yaml reader/writer, we should fix them to make it easy to do what we want to do.


More information about the llvm-commits mailing list