Calls to constructors of interdependent library instances are generated in the correct order only if all library instances in question have constructors. If some have no constructors, then the rest may see their constructors called out of order.
Cycle detection also only works when all library instances have constructors. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <[email protected]> --- .../BaseOrderedCollectionRedBlackTreeLib.inf | 2 ++ .../BaseOrderedCollectionRedBlackTreeLib.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf index a68afc8..f846a79 100644 --- a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf +++ b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf @@ -32,6 +32,8 @@ VERSION_STRING = 1.0 LIBRARY_CLASS = OrderedCollectionLib + CONSTRUCTOR = BaseOrderedCollectionRedBlackTreeLibConstructor + # # VALID_ARCHITECTURES = IA32 X64 IPF EBC # diff --git a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c index 8d18a4b..23ba8de 100644 --- a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c +++ b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c @@ -1452,3 +1452,13 @@ RedBlackTreeValidate ( DEBUG ((DEBUG_VERBOSE, "%a: Tree=%p BlackHeight=%Ld Count=%Ld\n", __FUNCTION__, Tree, (INT64)BlackHeight, (INT64)ForwardCount)); } + + +RETURN_STATUS +EFIAPI +BaseOrderedCollectionRedBlackTreeLibConstructor ( + VOID + ) +{ + return RETURN_SUCCESS; +} -- 1.8.3.1 ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
