]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/dl-utils: fix build on alpha
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 17 Jul 2026 18:14:01 +0000 (19:14 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 29 Jul 2026 12:31:56 +0000 (13:31 +0100)
Import change from systemd's sd-dlopen to fix build on alpha
as ".set" is overridden to mean something else, but on hppa
".equ" is also overridden.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
include/dl-utils.h

index 2dc7277d74c247ad2aa3851bd663e70c1d3827b4..8799d85c0e21c06a3244a9e2a6e7a0cba984595c 100644 (file)
@@ -55,10 +55,16 @@ extern int ul_dlopen_symbols(const char *libname, int flags,
 # define _UL_ELF_NOTE_DLOPEN_SECTION_FLAGS "aGR"
 #endif
 
+#if defined(__hppa__) || defined(__hppa64__)
+# define _UL_ELF_NOTE_DLOPEN_GUARD ".set"
+#else
+# define _UL_ELF_NOTE_DLOPEN_GUARD ".equ"
+#endif
+
 #define _UL_ELF_NOTE_DLOPEN(json)                                                                                            \
         __asm__ (                                                                                                             \
                 ".ifndef \"ul_dlopen:" json "\"\n"                                                                            \
-                ".set \"ul_dlopen:" json "\", 1\n"                                                                            \
+                _UL_ELF_NOTE_DLOPEN_GUARD " \"ul_dlopen:" json "\", 1\n"                                                      \
                 ".pushsection .note.dlopen, \"" _UL_ELF_NOTE_DLOPEN_SECTION_FLAGS "\", %note, \"ul_dlopen:" json "\", comdat\n" \
                 ".balign 4\n"                                                                                                 \
                 ".long 884f - 883f\n"                                                                                         \