You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many improvements to die interpretations given our explorations into high_pc (#89)
* many improvements to DWARF die interpretations given our explorations into `high_pc`
* fixing up tests
* adding dtor supplement until we get the high_pc shenanigans figured out there
* additional details around the qualified name of a symbol
Copy file name to clipboardExpand all lines: README.md
+20
Original file line number
Diff line number
Diff line change
@@ -255,3 +255,23 @@ The following flags are not currently in use or will undergo heavy changes as th
255
255
-`[orc_test_flags]`: A series of runtime settings to pass to the test app for this test.
256
256
257
257
-`[orc_flags]`: A series of runtime settings to pass to the ORC engine for this test.
258
+
259
+
# Appendix A: Destructor Implementations
260
+
261
+
It has been observed that the destructor of a given class can be different sizes across translation units. This is because the Itanium ABI defines [several destructor types](https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-ctor) which may contribute to the confusion. [Mark Rowe](https://www.linkedin.com/in/bdash/) provides an excellent synopsis:
262
+
263
+
> Presumably since you're seeing these destructors in multiple object files, they are declared in the header. The definitions have what is referred to as "vague linkage". For Mach-O this typically means they're emitted as weak definitions.
264
+
>
265
+
> At link time, the linker will use a strong definition for the symbol if it exists, otherwise it'll pick one of the weak definitions to use. If the symbol is not exported from the binary it'll be converted to a strong definition, otherwise it'll remain weak and the dynamic loader will do the same resolution process at load time (strong definition if one exists, otherwise pick one of the available weak definitions).
266
+
>
267
+
> If all of the various definitions are equivalent from an ABI point of view, it should not matter if they compile to slightly different code. However, if they are not ABI compatible, you'll have bugs that can be very hard to track down.
268
+
>
269
+
> `-fomit-frame-pointer` being used in some translation units and not others will result in code being generated for the same function. Different optimization levels will as well. Those should still be ABI-compatible though.
270
+
>
271
+
> Things like class members or virtual functions that are conditionally included or can change types based on `#if`s are a common source of problems.
272
+
>
273
+
> The other thing to be aware of is that for classes with virtual member functions, the compiler will often generate two destructors: the regular destructor, and the so-called "deleting" destructor. The deleting destructor is effectively a call to the regular destructor followed by a call to the appropriate `operator delete` implementation. If you're not distinguishing between these two types of destructors that may lead you to believe they're different sizes.
274
+
>
275
+
> The different destructor types are described in the Itanium ABI and can be distinguished via their mangled names.
276
+
277
+
(This appendix should be kept around until there is reasonable confidence that ORC is discerning between the various types and minimizing false positives.)
0 commit comments