Author: kib Date: Sun Jun 7 09:38:45 2020 New Revision: 361889 URL: https://svnweb.freebsd.org/changeset/base/361889
Log: MFC r360201: Fix ldd for PIE binaries with static TLS segment. PR: 245677 Modified: stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/rtld.h Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Sun Jun 7 09:17:57 2020 (r361888) +++ stable/11/libexec/rtld-elf/rtld.c Sun Jun 7 09:38:45 2020 (r361889) @@ -3303,7 +3303,7 @@ rtld_dlopen(const char *name, int fd, int mode) if (mode & RTLD_DEEPBIND) lo_flags |= RTLD_LO_DEEPBIND; if (ld_tracing != NULL) - lo_flags |= RTLD_LO_TRACE; + lo_flags |= RTLD_LO_TRACE | RTLD_LO_IGNSTLS; return (dlopen_object(name, fd, obj_main, lo_flags, mode & (RTLD_MODEMASK | RTLD_GLOBAL), NULL)); @@ -3356,15 +3356,15 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref if ((lo_flags & RTLD_LO_DEEPBIND) != 0) obj->symbolic = true; result = 0; - if ((lo_flags & RTLD_LO_EARLY) == 0 && obj->static_tls && - !allocate_tls_offset(obj)) { + if ((lo_flags & (RTLD_LO_EARLY | RTLD_LO_IGNSTLS)) == 0 && + obj->static_tls && !allocate_tls_offset(obj)) { _rtld_error("%s: No space available " "for static Thread Local Storage", obj->path); result = -1; } if (result != -1) result = load_needed_objects(obj, lo_flags & (RTLD_LO_DLOPEN | - RTLD_LO_EARLY)); + RTLD_LO_EARLY | RTLD_LO_IGNSTLS)); init_dag(obj); ref_dag(obj); if (result != -1) Modified: stable/11/libexec/rtld-elf/rtld.h ============================================================================== --- stable/11/libexec/rtld-elf/rtld.h Sun Jun 7 09:17:57 2020 (r361888) +++ stable/11/libexec/rtld-elf/rtld.h Sun Jun 7 09:38:45 2020 (r361889) @@ -303,6 +303,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry); #define RTLD_LO_FILTEES 0x10 /* Loading filtee. */ #define RTLD_LO_EARLY 0x20 /* Do not call ctors, postpone it to the initialization during the image start. */ +#define RTLD_LO_IGNSTLS 0x40 /* Do not allocate static TLS */ #define RTLD_LO_DEEPBIND 0x80 /* Force symbolic for this object */ /* _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"