[PATCH] [Core] Add type and size to SharedLibraryAtom

Michael Spencer bigcheesegs at gmail.com
Wed Sep 25 16:31:31 PDT 2013

  I'll split it up.

Comment at: include/lld/Core/SharedLibraryAtom.h:25-30
@@ -24,2 +24,8 @@
+  enum Type {
+    Unknown,
+    Function,
+    Object,
+  };
   /// Returns shared library name used to load it at runtime.
kledzik at apple.com wrote:
> These names only make sense if you know  STT_FUNC and  STT_OBJECT.  How about: unknown, code, data.  Also the SharedLibraryAtom is still small enough to get away with generic names like this, but making it an enum class would scope the names better.

Comment at: include/lld/Core/SharedLibraryAtom.h:43
@@ +42,3 @@
+  virtual uint64_t size() const = 0;
kledzik at apple.com wrote:
> This is a crazy runtime model that the build time size is needed.  It is not a very dynamic DSO if the data size grows and that breaks existing programs.   Does the loader check that the size in the program is the same as found in the DSO? or does it just blindly always copy just that much.
Yes, it checks that they are the same. It makes sense given that it's ABI breaking to change the type of a global in a DSO to begin with.


More information about the llvm-commits mailing list