From 8790142aebf22a9e0397ec63dfc7bad72a1ee7a6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Nov 2021 20:44:02 -0700 Subject: [PATCH] QPluginLoader: fix indentation and comments Indetnation was bad in commit 0ab3c5c2505dcfa684fd4a3961f24345de7e1d6f and was missed in code review and one comment wasn't updated when the code was. Take the opportunity to remove an old TODO that has been completed for years. Change-Id: Ice04365c72984d07a64dfffd16b4899604513680 Reviewed-by: Andrei Golubev --- src/corelib/plugin/qplugin.h | 8 +++----- tests/auto/corelib/plugin/qpluginloader/fakeplugin.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index 35af6205ccf..6efdcfe7f6c 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -160,7 +160,6 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin); # define QT_PLUGIN_METADATA_SECTION \ __attribute__ ((section (".qtmetadata"))) __attribute__((used)) #elif defined(Q_OS_MAC) -// TODO: Implement section parsing on Mac # define QT_PLUGIN_METADATA_SECTION \ __attribute__ ((section ("__TEXT,qtmetadata"))) __attribute__((used)) #elif defined(Q_CC_MSVC) @@ -200,12 +199,11 @@ template class QPluginMetaDataV2 using Payload = StaticPayload; #elif defined(Q_OF_ELF) # ifdef Q_CC_CLANG -// the metadata section doesn't work well with clang's sanitizer - QTBUG-97941 -# define QT_PLUGIN_METADATAV2_SECTION \ - __attribute__((section(".note.qt.metadata"), used, aligned(alignof(void *)), \ +# define QT_PLUGIN_METADATAV2_SECTION \ + __attribute__((section(".note.qt.metadata"), used, aligned(alignof(void *)), \ no_sanitize("address"))) # else -# define QT_PLUGIN_METADATAV2_SECTION \ +# define QT_PLUGIN_METADATAV2_SECTION \ __attribute__((section(".note.qt.metadata"), used, aligned(alignof(void *)))) # endif using Payload = ElfNotePayload; diff --git a/tests/auto/corelib/plugin/qpluginloader/fakeplugin.cpp b/tests/auto/corelib/plugin/qpluginloader/fakeplugin.cpp index c1b939bf3ed..899586ed157 100644 --- a/tests/auto/corelib/plugin/qpluginloader/fakeplugin.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/fakeplugin.cpp @@ -51,7 +51,7 @@ static constexpr bool IsDebug = false; #if defined(__ELF__) && PLUGIN_VERSION >= 1 // GCC will produce: -// fakeplugin.cpp:64:3: warning: ‘no_sanitize_address’ attribute ignored [-Wattributes] +// fakeplugin.cpp:64:3: warning: ‘no_sanitize’ attribute ignored [-Wattributes] __attribute__((section(".note.qt.metadata"), used, no_sanitize("address"), aligned(sizeof(void*)))) static const struct { unsigned n_namesz = sizeof(name);