libdlog: construct with the maximum priority 99/200399/1
authorMichal Bloch <m.bloch@samsung.com>
Fri, 22 Feb 2019 13:28:36 +0000 (14:28 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Fri, 22 Feb 2019 13:31:49 +0000 (14:31 +0100)
Change-Id: I4ee302ef4f016d1ba43ed5da6e4ddd6cd59f5122

src/libdlog/log.c

index 08aaebf..098d6b8 100644 (file)
@@ -139,11 +139,15 @@ void __update_plog(const struct log_config *conf)
 /**
  * @brief Configure the library
  * @details Reads relevant config values
+ * @remarks The constructor has the highest possible priority (100 and below are reserved).
+ *          This is because other libraries are likely to use libdlog and might want to
+ *          use it as early as in their own constructor. This means that libdlog must be
+ *          constructed as soon as possible.
  */
 #ifdef UNIT_TEST
 void __configure(void)
 #else
-static void __attribute__((constructor)) __configure(void)
+static void __attribute__((constructor(101))) __configure(void)
 #endif
 {
        struct log_config config;