Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:michals
glibc
dl-lookup-ignore-spurious-version.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File dl-lookup-ignore-spurious-version.patch of Package glibc
From: Michal Suchanek <msuchanek@suse.de> Sublect: dl-lookup: Ignore spurious version Debian/Ubuntu add symbol arbitrary versioning to libraries. This causes software built for these distributions to not run elsewhere. As a workaround try to lookup a non-versioned symbol when versioned lookup fails and LD_VERSION_FIXUP is set. Index: glibc-2.31/elf/dl-lookup.c =================================================================== --- glibc-2.31.orig/elf/dl-lookup.c +++ glibc-2.31/elf/dl-lookup.c @@ -865,6 +865,8 @@ _dl_lookup_symbol_x (const char *undef_n if (__glibc_unlikely (current_value.s == NULL)) { + if (version && GLRO(dl_version_fixup)) /* Retry without version if lookup fails */ + return _dl_lookup_symbol_x(undef_name, undef_map, ref, symbol_scope, NULL, type_class, flags, skip_map); if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)) { Index: glibc-2.31/elf/dl-support.c =================================================================== --- glibc-2.31.orig/elf/dl-support.c +++ glibc-2.31/elf/dl-support.c @@ -49,6 +49,7 @@ int _dl_debug_mask; int _dl_lazy; ElfW(Addr) _dl_use_load_bias = -2; int _dl_dynamic_weak; +int _dl_version_fixup; /* If nonzero print warnings about problematic situations. */ int _dl_verbose; @@ -334,6 +335,8 @@ _dl_non_dynamic_init (void) _dl_dynamic_weak = *(getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0'; + _dl_version_fixup = *(getenv ("LD_VERSION_FIXUP") ?: "") != '\0'; + _dl_profile_output = getenv ("LD_PROFILE_OUTPUT"); if (_dl_profile_output == NULL || _dl_profile_output[0] == '\0') _dl_profile_output Index: glibc-2.31/sysdeps/generic/unsecvars.h =================================================================== --- glibc-2.31.orig/sysdeps/generic/unsecvars.h +++ glibc-2.31/sysdeps/generic/unsecvars.h @@ -16,6 +16,7 @@ "LD_DEBUG\0" \ "LD_DEBUG_OUTPUT\0" \ "LD_DYNAMIC_WEAK\0" \ + "LD_VERSION_FIXUP\0" \ "LD_HWCAP_MASK\0" \ "LD_LIBRARY_PATH\0" \ "LD_ORIGIN_PATH\0" \ Index: glibc-2.31/sysdeps/generic/ldsodefs.h =================================================================== --- glibc-2.31.orig/sysdeps/generic/ldsodefs.h +++ glibc-2.31/sysdeps/generic/ldsodefs.h @@ -546,6 +546,9 @@ struct rtld_global_ro linking. */ EXTERN int _dl_dynamic_weak; + /* Nonzero if failing versioned lookups should be tried as non-versioned. */ + EXTERN int _dl_version_fixup; + /* Default floating-point control word. */ EXTERN fpu_control_t _dl_fpu_control; Index: glibc-2.31/elf/rtld.c =================================================================== --- glibc-2.31.orig/elf/rtld.c +++ glibc-2.31/elf/rtld.c @@ -2657,6 +2657,10 @@ process_envvars (enum mode *modep) GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0; break; } + + if (!__libc_enable_secure + && memcmp (envline, "VERSION_FIXUP", 13) == 0) + GLRO(dl_version_fixup) = 1; break; case 14:
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor