78c599
diff -ur libqb-1.0.3/configure.ac libqb-1.0.3.nosection/configure.ac
78c599
--- libqb-1.0.3/configure.ac	2017-12-21 09:02:11.000000000 +0000
78c599
+++ libqb-1.0.3.nosection/configure.ac	2018-08-16 10:24:25.425174367 +0100
78c599
@@ -644,139 +644,6 @@
78c599
 AM_CONDITIONAL(HAVE_SLOW_TESTS, [test "x${enable_slow_tests}" = xyes])
78c599
 AC_SUBST(HAVE_SLOW_TESTS)
78c599
 
78c599
-# --- callsite sections ---
78c599
-if test "x${GCC}" = xyes; then
78c599
-	AX_SAVE_FLAGS
78c599
-	AC_MSG_CHECKING([whether GCC supports __attribute__((section()) + ld supports orphan sections])
78c599
-	if test "x${ac_cv_link_attribute_section}" = x ; then
78c599
-		LDFLAGS="${LDFLAGS_save} -shared -fPIC"  # we are compiling shared lib
78c599
-		AC_LINK_IFELSE(
78c599
-			[AC_LANG_SOURCE(
78c599
-			    [[#include <assert.h>
78c599
-			      extern int __start___verbose[], __stop___verbose[];
78c599
-			      int test(void) {
78c599
-			        static int my_var __attribute__((section("__verbose"))) = 3;
78c599
-			        assert("L:non-empty data section"
78c599
-			               && __start___verbose != __stop___verbose);
78c599
-			        assert("L:no data section value loss"
78c599
-			               && my_var == 3  /* for 2.29.1+ */);
78c599
-			        return *((int *) __start___verbose); }]]
78c599
-			)],
78c599
-			[gcc_has_attribute_section=yes; cp "conftest${ac_exeext}" "conftest.so"],
78c599
-			[gcc_has_attribute_section=no]
78c599
-		)
78c599
-		AX_RESTORE_FLAGS
78c599
-	else
78c599
-		gcc_has_attribute_section=${ac_cv_link_attribute_section}
78c599
-	fi
78c599
-	AC_MSG_RESULT($gcc_has_attribute_section)
78c599
-
78c599
-	# in the failing case (e.g. with ld from binutils 2.29), it's likely the
78c599
-	# following will fail readily in linkage (hidden symbol `__stop___verbose'
78c599
-	# in conftest is referenced by DSO), but keep the sensible test
78c599
-	# (in-executable symbol is expected to be propagated into the library,
78c599
-	# and to draw the full circle back to the executable through standard
78c599
-	# return value passing (respectively no-exec probing to spot the issue);
78c599
-	# -rpath passed because LD_LIBRARY_PATH exporting is unwieldy here);
78c599
-	# moreover, "my_var" == 3 assertion above (respectively checking if the
78c599
-	# boundary symbol visibility differs from DEFAULT in readelf output) is
78c599
-	# necessary so that binutils 2.29.1+ will not slip other parts of the
78c599
-	# overall is-workaround-needed harness, as it restored some (but not
78c599
-	# all) of the original behaviour, but the workaround is still provably
78c599
-	# needed
78c599
-	if test "x${gcc_has_attribute_section}" = xyes; then
78c599
-		AC_MSG_CHECKING([whether linker emits global boundary symbols for orphan sections])
78c599
-		LIBS="${LIBS} -L. -l:conftest${shrext_cmds} -Wl,-rpath=$(pwd)"
78c599
-		dnl could be turned to AC_TRY_RUN (first assertion is equivalent to
78c599
-		dnl the further check in action-if-true), but that would prevent
78c599
-		dnl cross-building
78c599
-		AC_LINK_IFELSE(
78c599
-			[AC_LANG_PROGRAM(
78c599
-			    [[#include <assert.h>
78c599
-			      extern int __start___verbose[], __stop___verbose[];
78c599
-			      int test(void);]],
78c599
-			    [[static int my_var __attribute__((section("__verbose"))) = 5;
78c599
-			      assert("E:non-empty data section"
78c599
-			             && __start___verbose != __stop___verbose);
78c599
-			      assert("E:no data section value loss"
78c599
-			             && my_var == test() /*5?*/);]]
78c599
-			)],
78c599
-			[# alternatively something like (but requires number parsing):
78c599
-			 #   readelf -SW "conftest${ac_exeext}" \
78c599
-			 #   | sed -n '/__verbose/s/^\s*//p' | tr -s ' ' | cut -d" " -f6
78c599
-			 verbose_start_addr=$(${NM} -g --portability -- "conftest${ac_exeext}" \
78c599
-			                      | grep __start___verbose | cut -d" " -f 3)
78c599
-			 verbose_stop_addr=$(${NM} -g --portability -- "conftest${ac_exeext}" \
78c599
-			                      | grep __stop___verbose | cut -d" " -f 3)
78c599
-			 test "${verbose_start_addr}" = "${verbose_stop_addr}" \
78c599
-			   && gcc_has_attribute_section_visible=no \
78c599
-			   || { verbose_start_type=$(${READELF} -s backup \
78c599
-			                             | sed -n '/__start___verbose/{s/^\s*//p;q}' \
78c599
-			                             | tr -s ' ' \
78c599
-			                             | cut -d" " -f6)
78c599
-			        test "${verbose_start_type}" = DEFAULT \
78c599
-			          && gcc_has_attribute_section_visible=yes \
78c599
-			          || gcc_has_attribute_section_visible=no; }],
78c599
-			[gcc_has_attribute_section_visible=no]
78c599
-		)
78c599
-		AX_RESTORE_FLAGS
78c599
-		AC_MSG_RESULT($gcc_has_attribute_section_visible)
78c599
-		rm -f "conftest${shrext_cmds}"
78c599
-
78c599
-		if test "x${gcc_has_attribute_section_visible}" = xno; then
78c599
-			# check if the linker script based workaround is
78c599
-			# feasible at all, otherwise fallback to using no
78c599
-			# section attribute while making some noise about it
78c599
-			# as combining with-without accustomed logging
78c599
-			# participants is currently uncharted waters
78c599
-			AC_MSG_CHECKING([whether linker workaround for orphan sections usable])
78c599
-			>conftest.ld cat <<-EOF
78c599
-			SECTIONS {
78c599
-			  __verbose : {
78c599
-			    __start___verbose = .;
78c599
-			    *(__verbose);
78c599
-			    __stop___verbose = .;
78c599
-			  }
78c599
-			}
78c599
-			EOF
78c599
-			LDFLAGS="${LDFLAGS} -Wl,conftest.ld"
78c599
-			AC_LINK_IFELSE(
78c599
-				[AC_LANG_PROGRAM(
78c599
-				    [[#include <assert.h>
78c599
-				      extern int __start___verbose[], __stop___verbose[];
78c599
-				      int test(void);]],
78c599
-				    [[static int my_var __attribute__((section("__verbose"))) = 5;
78c599
-				      assert("E:non-empty data section"
78c599
-				             && __start___verbose != __stop___verbose);
78c599
-				      assert("E:no data section value loss"
78c599
-				             && my_var == 5);]]
78c599
-				)],
78c599
-				[],
78c599
-				[gcc_has_attribute_section=no]
78c599
-			)
78c599
-			AX_RESTORE_FLAGS
78c599
-			AC_MSG_RESULT([$gcc_has_attribute_section])
78c599
-			rm -f "conftest.ld"
78c599
-		fi
78c599
-
78c599
-		if test "x${gcc_has_attribute_section}" = xyes; then
78c599
-			AC_DEFINE([QB_HAVE_ATTRIBUTE_SECTION], 1,
78c599
-				  [Enabling code using __attribute__((section))])
78c599
-			AC_SUBST([client_dlopen_LIBS],[$dlopen_LIBS])
78c599
-			if test "x${gcc_has_attribute_section_visible}" = xyes; then
78c599
-				PACKAGE_FEATURES="$PACKAGE_FEATURES attribute-section"
78c599
-			else
78c599
-				AC_DEFINE([QB_NEED_ATTRIBUTE_SECTION_WORKAROUND], 1,
78c599
-					  [Enabling code using __attribute__((section))])
78c599
-				PACKAGE_FEATURES="$PACKAGE_FEATURES attribute-section-workaround"
78c599
-			fi
78c599
-		elif test "x${enable_nosection_fallback}" = xyes; then
78c599
-			AC_MSG_NOTICE([Falling back to not using orphan section])
78c599
-		else
78c599
-			AC_MSG_ERROR([Would use section attribute, cannot; see --enable-nosection-fallback])
78c599
-		fi
78c599
-	fi
78c599
-fi
78c599
 AM_CONDITIONAL(HAVE_GCC_ATTRIBUTE_SECTION, [test "x${gcc_has_attribute_section}" = xyes])
78c599
 AM_CONDITIONAL(NEED_GCC_ATTRIBUTE_SECTION_WORKAROUND,
78c599
 	       [test "x${gcc_has_attribute_section}" = xyes \
78c599
diff -ur libqb-1.0.3/include/qb/qbconfig.h.in libqb-1.0.3.nosection/include/qb/qbconfig.h.in
78c599
--- libqb-1.0.3/include/qb/qbconfig.h.in	2017-12-14 09:25:16.000000000 +0000
78c599
+++ libqb-1.0.3.nosection/include/qb/qbconfig.h.in	2018-08-16 10:23:15.018923879 +0100
78c599
@@ -27,9 +27,6 @@
78c599
 /* need atomic memory barrier */
78c599
 #undef QB_ATOMIC_OP_MEMORY_BARRIER_NEEDED
78c599
 
78c599
-/* Enabling code using __attribute__((section)) */
78c599
-#undef QB_HAVE_ATTRIBUTE_SECTION
78c599
-
78c599
 /* versioning info: MAJOR, MINOR, MICRO, and REST components;
78c599
    note that static compile-time info is not that useful as consulting
78c599
    the respectively named members of qb_version struct constant under
78c599
diff -ur libqb-1.0.3/include/qb/qblog.h libqb-1.0.3.nosection/include/qb/qblog.h
78c599
--- libqb-1.0.3/include/qb/qblog.h	2017-12-21 09:02:11.000000000 +0000
78c599
+++ libqb-1.0.3.nosection/include/qb/qblog.h	2018-08-16 10:23:15.018923879 +0100
78c599
@@ -39,15 +39,6 @@
78c599
 #include <qb/qbutil.h>
78c599
 #include <qb/qbconfig.h>
78c599
 
78c599
-#if defined(QB_KILL_ATTRIBUTE_SECTION) || defined(S_SPLINT_S)
78c599
-#undef QB_HAVE_ATTRIBUTE_SECTION
78c599
-#endif  /* defined(QB_KILL_ATTRIBUTE_SECTION) || defined(S_SPLINT_S) */
78c599
-
78c599
-#ifdef QB_HAVE_ATTRIBUTE_SECTION
78c599
-#include <assert.h>  /* possibly needed for QB_LOG_INIT_DATA */
78c599
-#include <dlfcn.h>  /* dynamic linking: dlopen, dlsym, dladdr, ... */
78c599
-#endif
78c599
-
78c599
 /**
78c599
  * @file qblog.h
78c599
  * The logging API provides four main parts (basics, filtering, threading & blackbox).
78c599
@@ -286,119 +277,7 @@
78c599
 
78c599
 typedef void (*qb_log_filter_fn)(struct qb_log_callsite * cs);
78c599
 
78c599
-/* will be assigned by linker magic (assuming linker supports that):
78c599
- * https://sourceware.org/binutils/docs/ld/Orphan-Sections.html
78c599
- */
78c599
-#ifdef QB_HAVE_ATTRIBUTE_SECTION
78c599
-
78c599
-#define QB_ATTR_SECTION			__verbose  /* conforms to C ident. */
78c599
-#define QB_ATTR_SECTION_STR		QB_PP_STRINGIFY(QB_ATTR_SECTION)
78c599
-#define QB_ATTR_SECTION_START		QB_PP_JOIN(__start_, QB_ATTR_SECTION)
78c599
-#define QB_ATTR_SECTION_STOP		QB_PP_JOIN(__stop_, QB_ATTR_SECTION)
78c599
-#define QB_ATTR_SECTION_START_STR	QB_PP_STRINGIFY(QB_ATTR_SECTION_START)
78c599
-#define QB_ATTR_SECTION_STOP_STR	QB_PP_STRINGIFY(QB_ATTR_SECTION_STOP)
78c599
-
78c599
-extern struct qb_log_callsite QB_ATTR_SECTION_START[];
78c599
-extern struct qb_log_callsite QB_ATTR_SECTION_STOP[];
78c599
-
78c599
-/* Related to the next macro that is -- unlike this one -- a public API */
78c599
-#ifndef _GNU_SOURCE
78c599
-#define QB_NONAPI_LOG_INIT_DATA_EXTRA_(name)				\
78c599
-	_Pragma(QB_PP_STRINGIFY(GCC warning QB_PP_STRINGIFY(		\
78c599
-	        without "_GNU_SOURCE" defined (directly or not) 	\
78c599
-		QB_LOG_INIT_DATA cannot check sanity of libqb proper	\
78c599
-		nor of the target site originating this check alone)))
78c599
-#else
78c599
-#define QB_NONAPI_LOG_INIT_DATA_EXTRA_(name)				\
78c599
-    { Dl_info work_dli;							\
78c599
-    /* libqb sanity (locating libqb by it's relatively unique		\
78c599
-       non-functional symbols -- the two are mutually exclusive, the	\
78c599
-       ordinarily latter was introduced by accident, the former is	\
78c599
-       intentional -- due to possible confusion otherwise) */		\
78c599
-    if ((dladdr(dlsym(RTLD_DEFAULT, "qb_ver_str"), &work_dli)		\
78c599
-         || dladdr(dlsym(RTLD_DEFAULT, "facilitynames"), &work_dli))	\
78c599
-        && (work_handle = dlopen(work_dli.dli_fname,			\
78c599
-                                 RTLD_LOCAL|RTLD_LAZY)) != NULL) {	\
78c599
-        work_s1 = (struct qb_log_callsite *)				\
78c599
-                  dlsym(work_handle, QB_ATTR_SECTION_START_STR);	\
78c599
-        work_s2 = (struct qb_log_callsite *)				\
78c599
-                  dlsym(work_handle, QB_ATTR_SECTION_STOP_STR);		\
78c599
-        assert("libqb's callsite section is observable, otherwise \
78c599
-libqb's build is at fault, preventing reliable logging"			\
78c599
-               && work_s1 != NULL && work_s2 != NULL);			\
78c599
-        assert("libqb's callsite section is populated, otherwise \
78c599
-libqb's build is at fault, preventing reliable logging"			\
78c599
-               && work_s1 != work_s2);					\
78c599
-        dlclose(work_handle); }						\
78c599
-    /* sanity of the target site originating this check alone */	\
78c599
-    if (dladdr(dlsym(RTLD_DEFAULT, QB_PP_STRINGIFY(name)), &work_dli)	\
78c599
-        && (work_handle = dlopen(work_dli.dli_fname,			\
78c599
-                                 RTLD_LOCAL|RTLD_LAZY)) != NULL) {	\
78c599
-        work_s1 = (struct qb_log_callsite *)				\
78c599
-                  dlsym(work_handle, QB_ATTR_SECTION_START_STR);	\
78c599
-        work_s2 = (struct qb_log_callsite *)				\
78c599
-                  dlsym(work_handle, QB_ATTR_SECTION_STOP_STR);		\
78c599
-        assert("target's own callsite section observable, otherwise \
78c599
-target's own linkage at fault and logging would not work reliably \
78c599
-(unless QB_LOG_INIT_DATA macro used unexpectedly in no-logging context)"\
78c599
-               && work_s1 != NULL && work_s2 != NULL);			\
78c599
-        assert("target's own callsite section non-empty, otherwise \
78c599
-target's own linkage at fault and logging would not work reliably \
78c599
-(unless QB_LOG_INIT_DATA macro used unexpectedly in no-logging context)"\
78c599
-               && work_s1 != work_s2);					\
78c599
-        dlclose(work_handle); } }
78c599
-#endif  /* _GNU_SOURCE */
78c599
-
78c599
-/**
78c599
- * Optional on-demand self-check of 1/ toolchain sanity (prerequisite for
78c599
- * the logging subsystem to work properly) and 2/ non-void active use of
78c599
- * logging (satisfied with a justifying existence of a logging callsite as
78c599
- * defined with a @c qb_logt invocation) at the target (but see below), which
78c599
- * is supposedly assured by it's author(!) as of relying on this very macro
78c599
- * [technically, the symbols that happen to be resolved under the respective
78c599
- * identifiers do not necessarily originate in the same compilation unit as
78c599
- * when it's not the end executable (or by induction, a library positioned
78c599
- * earlier in the symbol lookup order) but a shared library, the former takes
78c599
- * a precedence unless that site comes short of exercising the logging,
78c599
- * making its callsite section empty and, in turn, without such boundary
78c599
- * symbols, hence making the resolution continue further in the lookup order
78c599
- * -- despite fuzzily targeted attestation, the check remains reasonable];
78c599
- * only effective when link-time ("run-time amortizing") callsite collection
78c599
- * is;  as a side effect, it can ensure the boundary-denoting symbols for the
78c599
- * target collection area are kept alive with some otherwise unkind linkers.
78c599
- *
78c599
- * Applying this macro in the target program/library is strongly recommended
78c599
- * whenever the logging as framed by this header file is in use.
78c599
- * Moreover, it's important to state that using this check while not ensuring
78c599
- * @c _GNU_SOURCE macro definition is present at compile-time means only half
78c599
- * of the available sanity checking will be performed, possibly resulting
78c599
- * in libqb's own internally logged messages being lost without warning.
78c599
- */
78c599
-#define QB_LOG_INIT_DATA(name)						\
78c599
-    void name(void);							\
78c599
-    void name(void) {							\
78c599
-    void *work_handle; struct qb_log_callsite *work_s1, *work_s2;	\
78c599
-    /* our own (target's) sanity, or possibly that of higher priority	\
78c599
-       symbol resolution site (unless target equals end executable)	\
78c599
-       or even the lower one if no such predecessor defines these */	\
78c599
-    if ((work_handle = dlopen(NULL, RTLD_LOCAL|RTLD_LAZY)) != NULL) {	\
78c599
-        work_s1 = (struct qb_log_callsite *)				\
78c599
-                  dlsym(work_handle, QB_ATTR_SECTION_START_STR);	\
78c599
-        work_s2 = (struct qb_log_callsite *)				\
78c599
-                  dlsym(work_handle, QB_ATTR_SECTION_STOP_STR);		\
78c599
-        assert("implicit callsite section is observable, otherwise \
78c599
-target's and/or libqb's build is at fault, preventing reliable logging" \
78c599
-               && work_s1 != NULL && work_s2 != NULL);			\
78c599
-        dlclose(work_handle);  /* perhaps overly eager thing to do */ }	\
78c599
-    QB_NONAPI_LOG_INIT_DATA_EXTRA_(name);				\
78c599
-    /* finally, original, straightforward check */			\
78c599
-    assert("implicit callsite section is populated, otherwise \
78c599
-target's build is at fault, preventing reliable logging"		\
78c599
-           && QB_ATTR_SECTION_START != QB_ATTR_SECTION_STOP); }		\
78c599
-    void __attribute__ ((constructor)) name(void);
78c599
-#else
78c599
 #define QB_LOG_INIT_DATA(name)
78c599
-#endif  /* QB_HAVE_ATTRIBUTE_SECTION */
78c599
 
78c599
 /**
78c599
  * Internal function: use qb_log() or qb_logt()
78c599
@@ -476,21 +355,12 @@
78c599
  * @param fmt usual printf style format specifiers
78c599
  * @param args usual printf style args
78c599
  */
78c599
-#ifdef QB_HAVE_ATTRIBUTE_SECTION
78c599
-#define qb_logt(priority, tags, fmt, args...) do {			\
78c599
-	static struct qb_log_callsite descriptor			\
78c599
-	__attribute__((section(QB_ATTR_SECTION_STR), aligned(8))) =	\
78c599
-	{ __func__, __FILE__, fmt, priority, __LINE__, 0, tags };	\
78c599
-	qb_log_real_(&descriptor, ##args);				\
78c599
-    } while(0)
78c599
-#else
78c599
 #define qb_logt(priority, tags, fmt, args...) do {	\
78c599
 	struct qb_log_callsite* descriptor_pt =		\
78c599
 	qb_log_callsite_get(__func__, __FILE__, fmt,	\
78c599
 			    priority, __LINE__, tags);	\
78c599
 	qb_log_real_(descriptor_pt, ##args);		\
78c599
     } while(0)
78c599
-#endif /* QB_HAVE_ATTRIBUTE_SECTION */
78c599
 
78c599
 
78c599
 /**
78c599
--- libqb-1.0.3/lib/libqb.pc.in	2017-12-14 09:25:16.000000000 +0000
78c599
+++ libqb-1.0.3.nosection/lib/libqb.pc.in	2018-08-16 10:23:15.019923883 +0100
78c599
@@ -7,17 +7,6 @@
78c599
 Version: @PACKAGE_VERSION@
78c599
 Description: libqb
78c599
 Requires:
78c599
-Libs: -L${libdir} -lqb @client_dlopen_LIBS@
78c599
-# NOTE: If -lqb not usable for linking (e.g. linker not compatible with
78c599
-#       linker scripts ad-hoc modifying output sections), try recent
78c599
-#       ld.bfd/binutils linker first when available, otherwise you can
78c599
-#       try "-l:libqb.so.<digit>" link switch that bypasses said linker
78c599
-#       script -- but beware, logging may be less efficient and may lack
78c599
-#       possible future optimizations and extra features.  Consequently,
78c599
-#       logging issues (typically bound to QB_LOG_INIT_DATA macro) can be
78c599
-#       mitigated with QB_KILL_ATTRIBUTE_SECTION macro defined for a build.
78c599
-# NOTE: when concerned about a warning coming from the build process like
78c599
-#       warning: [...]libqb.so contains output sections; did you forget -T?
78c599
-#       and the build finishes OK, take it merely as a harmless side-effect
78c599
+Libs: -L${libdir} -lqb
78c599
 Libs.private: @LIBS@
78c599
 Cflags: -I${includedir}
78c599
diff -ur libqb-1.0.3/lib/log.c libqb-1.0.3.nosection/lib/log.c
78c599
--- libqb-1.0.3/lib/log.c	2017-12-21 09:02:11.000000000 +0000
78c599
+++ libqb-1.0.3.nosection/lib/log.c	2018-08-16 10:26:01.465514061 +0100
78c599
@@ -40,13 +40,6 @@
78c599
 #include "util_int.h"
78c599
 #include <regex.h>
78c599
 
78c599
-#if defined(QB_NEED_ATTRIBUTE_SECTION_WORKAROUND) && !defined(S_SPLINT_S)
78c599
-/* following only needed to force these symbols be global
78c599
-   with ld 2.29: https://bugzilla.redhat.com/1477354 */
78c599
-struct qb_log_callsite __attribute__((weak)) QB_ATTR_SECTION_START[] = { {0} };
78c599
-struct qb_log_callsite __attribute__((weak)) QB_ATTR_SECTION_STOP[] = { {0} };
78c599
-#endif
78c599
-
78c599
 static struct qb_log_target conf[QB_LOG_TARGET_MAX];
78c599
 static uint32_t conf_active_max = 0;
78c599
 static int32_t in_logger = QB_FALSE;
78c599
@@ -772,73 +765,6 @@
78c599
 	return qb_log_filter_ctl2(t, c, type, text, LOG_EMERG, priority);
78c599
 }
78c599
 
78c599
-#ifdef QB_HAVE_ATTRIBUTE_SECTION
78c599
-/* Some platforms (eg. FreeBSD 10+) don't support calling dlopen() from
78c599
- * within a dl_iterate_phdr() callback; so save all of the dlpi_names to
78c599
- * a list and iterate over them afterwards. */
78c599
-static int32_t
78c599
-_log_so_walk_callback(struct dl_phdr_info *info, size_t size, void *data)
78c599
-{
78c599
-	struct dlname *dlname;
78c599
-
78c599
-	if (strlen(info->dlpi_name) > 0) {
78c599
-		dlname = calloc(1, sizeof(struct dlname));
78c599
-		if (!dlname)
78c599
-			return 0;
78c599
-		dlname->dln_name = strdup(info->dlpi_name);
78c599
-		qb_list_add_tail(&dlname->list, &dlnames);
78c599
-	}
78c599
-
78c599
-	return 0;
78c599
-}
78c599
-
78c599
-static void
78c599
-_log_so_walk_dlnames(void)
78c599
-{
78c599
-	struct dlname *dlname;
78c599
-	struct qb_list_head *iter;
78c599
-	struct qb_list_head *next;
78c599
-
78c599
-	void *handle;
78c599
-	void *start;
78c599
-	void *stop;
78c599
-	const char *error;
78c599
-
78c599
-	qb_list_for_each_safe(iter, next, &dlnames) {
78c599
-		dlname = qb_list_entry(iter, struct dlname, list);
78c599
-
78c599
-		handle = dlopen(dlname->dln_name, RTLD_LAZY);
78c599
-		error = dlerror();
78c599
-		if (!handle || error) {
78c599
-			qb_log(LOG_ERR, "%s", error);
78c599
-			goto done;
78c599
-		}
78c599
-
78c599
-		start = dlsym(handle, QB_ATTR_SECTION_START_STR);
78c599
-		error = dlerror();
78c599
-		if (error) {
78c599
-			goto done;
78c599
-		}
78c599
-
78c599
-		stop = dlsym(handle, QB_ATTR_SECTION_STOP_STR);
78c599
-		error = dlerror();
78c599
-		if (error) {
78c599
-			goto done;
78c599
-
78c599
-		} else {
78c599
-			qb_log_callsites_register(start, stop);
78c599
-		}
78c599
-done:
78c599
-		if (handle)
78c599
-			dlclose(handle);
78c599
-		qb_list_del(iter);
78c599
-		if (dlname->dln_name)
78c599
-			free(dlname->dln_name);
78c599
-		free(dlname);
78c599
-	}
78c599
-}
78c599
-#endif /* QB_HAVE_ATTRIBUTE_SECTION */
78c599
-
78c599
 static void
78c599
 _log_target_state_set(struct qb_log_target *t, enum qb_log_target_state s)
78c599
 {
78c599
@@ -864,10 +790,6 @@
78c599
 {
78c599
 	int32_t l;
78c599
 	enum qb_log_target_slot i;
78c599
-#ifdef QB_HAVE_ATTRIBUTE_SECTION
78c599
-	void *work_handle; struct qb_log_callsite *work_s1, *work_s2;
78c599
-	Dl_info work_dli;
78c599
-#endif /* QB_HAVE_ATTRIBUTE_SECTION */
78c599
 	/* cannot reuse single qb_log invocation in various contexts
78c599
 	   through the variables (when section attribute in use),
78c599
 	   hence this indirection */
78c599
@@ -893,33 +815,6 @@
78c599
 	}
78c599
 
78c599
 	qb_log_dcs_init();
78c599
-#ifdef QB_HAVE_ATTRIBUTE_SECTION
78c599
-	/* sanity check that target chain supplied QB_ATTR_SECTION_ST{ART,OP}
78c599
-	   symbols and hence the local references to them are not referencing
78c599
-	   the proper libqb's ones (locating libqb by it's relatively unique
78c599
-	   non-functional symbols -- the two are mutually exclusive, the
78c599
-	   ordinarily latter was introduced by accident, the former is
78c599
-	   intentional -- due to possible confusion otherwise) */
78c599
-	if ((dladdr(dlsym(RTLD_DEFAULT, "qb_ver_str"), &work_dli)
78c599
-	     || dladdr(dlsym(RTLD_DEFAULT, "facilitynames"), &work_dli))
78c599
-	    && (work_handle = dlopen(work_dli.dli_fname,
78c599
-	                             RTLD_LOCAL|RTLD_LAZY)) != NULL) {
78c599
-		work_s1 = (struct qb_log_callsite *)
78c599
-		          dlsym(work_handle, QB_ATTR_SECTION_START_STR);
78c599
-		work_s2 = (struct qb_log_callsite *)
78c599
-		          dlsym(work_handle, QB_ATTR_SECTION_STOP_STR);
78c599
-		if (work_s1 == QB_ATTR_SECTION_START
78c599
-		    || work_s2 == QB_ATTR_SECTION_STOP) {
78c599
-			preinit_err = preinit_err_target_sec;
78c599
-		} else if (work_s1 == work_s2) {
78c599
-			preinit_err = preinit_err_target_empty;
78c599
-		}
78c599
-		dlclose(work_handle);  /* perhaps overly eager thing to do */
78c599
-	}
78c599
-	qb_log_callsites_register(QB_ATTR_SECTION_START, QB_ATTR_SECTION_STOP);
78c599
-	dl_iterate_phdr(_log_so_walk_callback, NULL);
78c599
-	_log_so_walk_dlnames();
78c599
-#endif /* QB_HAVE_ATTRIBUTE_SECTION */
78c599
 
78c599
 	for (i = QB_LOG_TARGET_STATIC_START; i < QB_LOG_TARGET_STATIC_MAX; i++)
78c599
 		conf[i].state = QB_LOG_STATE_DISABLED;
78c599
diff -ur libqb-1.0.3/lib/Makefile.am libqb-1.0.3.nosection/lib/Makefile.am
78c599
--- libqb-1.0.3/lib/Makefile.am	2017-12-14 09:25:16.000000000 +0000
78c599
+++ libqb-1.0.3.nosection/lib/Makefile.am	2018-08-16 10:25:07.001321422 +0100
78c599
@@ -79,9 +79,6 @@
78c599
 libqb_la_SOURCES	= $(source_to_lint) unix.c
78c599
 libqb_la_CFLAGS		= $(PTHREAD_CFLAGS)
78c599
 libqb_la_LIBADD		= $(LTLIBOBJS) $(dlopen_LIBS) $(PTHREAD_LIBS) $(socket_LIBS)
78c599
-if NEED_GCC_ATTRIBUTE_SECTION_WORKAROUND
78c599
-libqb_la_LIBADD 	+= qblog_script.la
78c599
-endif
78c599
 
78c599
 AM_LDFLAGS 	= $(LDFLAGS_COPY:-Bsymbolic-functions=)
78c599
 
78c599
@@ -110,33 +107,6 @@
78c599
 pkgconfigexecdir = $(libdir)/pkgconfig
78c599
 pkgconfigexec_DATA = libqb.pc
78c599
 
78c599
-# find the libqb.so symlink's target, if so, try to find out, iteratively,
78c599
-# its gradually shorter forms that likewise symlinks the same target as the
78c599
-# original libqb.so path, point to that file from the linker script using
78c599
-# qblog_script.ld as a template, storing result in place of original libqb.so
78c599
-# (e.g., libqb.so := "INPUT(libqb.so.0) " [...] "SECTIONS { " [...] "}")
78c599
-# NOTE: readlink nor realpath are POSIX; not chained links ready
78c599
-# NOTE: conservative check, i.e., not per NEED_GCC_ATTRIBUTE_SECTION_WORKAROUND
78c599
-if HAVE_GCC_ATTRIBUTE_SECTION
78c599
-install-exec-hook: qblog_script.ld
78c599
-	target=$$(ls -l "$(DESTDIR)$(libdir)/libqb.so" || :); \
78c599
-	  target=$${target#* -> }; t1_bn=$$(basename "$${target}" || :); \
78c599
-	  while test -n "$${t1_bn}"; do t2_bn=$${t1_bn%.*[0-9]*}; \
78c599
-	  test "$${t2_bn}" != libqb.so || break; \
78c599
-	  test -L "$${t2_bn}" || { t1_bn=$${t2_bn}; continue; }; \
78c599
-	  t2_target=$$(ls -l "$${t2_bn}" || break); t2_target=$${t2_target#* -> }; \
78c599
-	  test "$${t2_target}" = "$${target}" || break; \
78c599
-	  t1_bn=$${t2_bn}; done; test -n "$${t1_bn}" || \
78c599
-	  { echo "only applicable to SO symlink scheme"; exit 1; }; \
78c599
-	  echo "$${t1_bn}" > "$(DESTDIR)$(libdir)/libqb.so-t"
78c599
-	so_ver=$$(cat "$(DESTDIR)$(libdir)/libqb.so-t"); \
78c599
-	  echo "INPUT($${so_ver})" > "$(DESTDIR)$(libdir)/libqb.so-t"; \
78c599
-	  cat $< >> "$(DESTDIR)$(libdir)/libqb.so-t"; \
78c599
-	  sed -i -- "s/libqb.so.<digit>/$${so_ver}/" \
78c599
-	    "$(DESTDIR)$(libdir)/libqb.so-t" "$(DESTDIR)$(pkgconfigexecdir)/libqb.pc"
78c599
-	mv -f "$(DESTDIR)$(libdir)/libqb.so-t" "$(DESTDIR)$(libdir)/libqb.so"
78c599
-endif
78c599
-
78c599
 if HAVE_SPLINT
78c599
 check_SCRIPTS = run_splint.sh
78c599
 TESTS = $(check_SCRIPTS)