[xen staging] xen/compiler: introduce a define for weak symbols

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen staging] xen/compiler: introduce a define for weak symbols

patchbot
commit 38e53a33795a88f305f30f63b7f9548e446ba2ab
Author:     Roger Pau Monné <[hidden email]>
AuthorDate: Tue Jul 31 10:23:37 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Tue Jul 31 10:23:37 2018 +0200

    xen/compiler: introduce a define for weak symbols
   
    And replace the open-coded versions already in tree. No functional
    change.
   
    Signed-off-by: Roger Pau Monné <[hidden email]>
    Reivewed-by: Andrew Cooper <[hidden email]>
    Reviewed-by: Ross Lagerwall <[hidden email]>
---
 xen/include/xen/compiler.h          | 2 ++
 xen/include/xen/livepatch_payload.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index a7e05681c9..ff6c0f5cdd 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -18,6 +18,8 @@
 
 #define __packed      __attribute__((__packed__))
 
+#define __weak        __attribute__((__weak__))
+
 #if (!defined(__clang__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5))
 #define unreachable() do {} while (1)
 #else
diff --git a/xen/include/xen/livepatch_payload.h b/xen/include/xen/livepatch_payload.h
index 8f38cc2c60..4a1a96d054 100644
--- a/xen/include/xen/livepatch_payload.h
+++ b/xen/include/xen/livepatch_payload.h
@@ -24,7 +24,7 @@ typedef void livepatch_unloadcall_t(void);
  * executed in series by the livepatch infrastructure at patch load time.
  */
 #define LIVEPATCH_LOAD_HOOK(_fn) \
-    livepatch_loadcall_t *__attribute__((weak)) \
+    livepatch_loadcall_t *__weak \
         const livepatch_load_data_##_fn __section(".livepatch.hooks.load") = _fn;
 
 /*
@@ -33,7 +33,7 @@ typedef void livepatch_unloadcall_t(void);
  * Same as LOAD hook with s/load/unload/
  */
 #define LIVEPATCH_UNLOAD_HOOK(_fn) \
-     livepatch_unloadcall_t *__attribute__((weak)) \
+     livepatch_unloadcall_t *__weak \
         const livepatch_unload_data_##_fn __section(".livepatch.hooks.unload") = _fn;
 
 #endif /* __XEN_LIVEPATCH_PAYLOAD_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog