Project

General

Profile

Bug #1231 » 0001-Fix-plugin-dev.h-Disable-address-sanitizer-on-pointe.patch

Mathieu Desnoyers, 02/17/2020 06:39 PM

View differences:

include/babeltrace2/plugin/plugin-dev.h
2660 2660
	};								\
2661 2661
	static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name
2662 2662

  
2663
#if defined(__clang__) || defined (__GNUC__)
2664
# define __BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
2665
#else
2666
# define __BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2667
#endif
2668

  
2663 2669
/*
2664 2670
 * Variable attributes for a plugin descriptor pointer to be added to
2665 2671
 * the plugin descriptor section (internal use).
2666 2672
 */
2667 2673
#ifdef __APPLE__
2668 2674
#define __BT_PLUGIN_DESCRIPTOR_ATTRS \
2669
	__attribute__((section("__DATA,btp_desc"), used))
2675
	__attribute__((section("__DATA,btp_desc"), used)) \
2676
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2670 2677

  
2671 2678
#define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
2672 2679
	__start___bt_plugin_descriptors
......
2683 2690
#else
2684 2691

  
2685 2692
#define __BT_PLUGIN_DESCRIPTOR_ATTRS \
2686
	__attribute__((section("__bt_plugin_descriptors"), used))
2693
	__attribute__((section("__bt_plugin_descriptors"), used)) \
2694
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2687 2695

  
2688 2696
#define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
2689 2697
	__start___bt_plugin_descriptors
......
2702 2710
 */
2703 2711
#ifdef __APPLE__
2704 2712
#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
2705
	__attribute__((section("__DATA,btp_desc_att"), used))
2713
	__attribute__((section("__DATA,btp_desc_att"), used)) \
2714
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2706 2715

  
2707 2716
#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2708 2717
	__start___bt_plugin_descriptor_attributes
......
2719 2728
#else
2720 2729

  
2721 2730
#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
2722
	__attribute__((section("__bt_plugin_descriptor_attributes"), used))
2731
	__attribute__((section("__bt_plugin_descriptor_attributes"), used)) \
2732
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2723 2733

  
2724 2734
#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2725 2735
	__start___bt_plugin_descriptor_attributes
......
2738 2748
 */
2739 2749
#ifdef __APPLE__
2740 2750
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
2741
	__attribute__((section("__DATA,btp_cc_desc"), used))
2751
	__attribute__((section("__DATA,btp_cc_desc"), used)) \
2752
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2742 2753

  
2743 2754
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
2744 2755
	__start___bt_plugin_component_class_descriptors
......
2755 2766
#else
2756 2767

  
2757 2768
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
2758
	__attribute__((section("__bt_plugin_component_class_descriptors"), used))
2769
	__attribute__((section("__bt_plugin_component_class_descriptors"), used)) \
2770
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2759 2771

  
2760 2772
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
2761 2773
	__start___bt_plugin_component_class_descriptors
......
2775 2787
 */
2776 2788
#ifdef __APPLE__
2777 2789
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
2778
	__attribute__((section("__DATA,btp_cc_desc_att"), used))
2790
	__attribute__((section("__DATA,btp_cc_desc_att"), used)) \
2791
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2779 2792

  
2780 2793
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2781 2794
	__start___bt_plugin_component_class_descriptor_attributes
......
2792 2805
#else
2793 2806

  
2794 2807
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
2795
	__attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used))
2808
	__attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used)) \
2809
	__BT_PLUGIN_ATTRIBUTE_NO_SANITIZE_ADDRESS
2796 2810

  
2797 2811
#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2798 2812
	__start___bt_plugin_component_class_descriptor_attributes
2799
- 
(1-1/2)