Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jan 2025 16:20:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        ppc@FreeBSD.org
Subject:   [Bug 235751] Failure to init TLS variables with func ptr inside shared lib
Message-ID:  <bug-235751-21-REmWYbuHj3@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-235751-21@https.bugs.freebsd.org/bugzilla/>
References:  <bug-235751-21@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235751

--- Comment #8 from Dennis Clarke <dclarke@blastwave.org> ---
(In reply to Konstantin Belousov from comment #7)

What precisely did you do?

I see no way that you made this work just fine on a 14.0-STABLE system
when it fails in the same way on 13.4-RELEASE-p1 machine :=20

$ uname -apKU=20
FreeBSD dasoyva 13.4-RELEASE-p1 FreeBSD 13.4-RELEASE-p1 GENERIC amd64 amd64
1304000 1304000
$ freebsd-version -kru=20
13.4-RELEASE-p1
13.4-RELEASE-p1
13.4-RELEASE-p2
$=20
$ which cc
/usr/bin/cc
$ CC=3D/usr/bin/cc
$ export CC
$=20
$ $CC --version
FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git
llvmorg-18.1.6-0-g1118c2e05e67)
Target: x86_64-unknown-freebsd13.4
Thread model: posix
InstalledDir: /usr/bin
$

$ $CC -std=3Diso9899:1999 -pedantic -pedantic-errors -m64 -g -O0 -fno-built=
in
-shared -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=3D64 -D_XOPEN_SOURCE=3D600
-D_REENTRANT -o t1.so -fPIC t1.c

$ $CC -std=3Diso9899:1999 -pedantic -pedantic-errors -m64 -g -O0 -fno-built=
in
-shared -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=3D64 -D_XOPEN_SOURCE=3D600
-D_REENTRANT -o foo t2.c t1.so

$ file foo
foo: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically
linked, for FreeBSD 13.4, with debug_info, not stripped

$ readelf -delV foo | grep -E 'NEED|NAME|PATH'
 0x0000000000000001 NEEDED               Shared library: [t1.so]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x000000006ffffffe VERNEED              0x340
 0x000000006fffffff VERNEEDNUM           1

$ ./foo
Segmentation fault (core dumped)

$ LD_LIBRARY_PATH=3D`pwd` ./foo
Segmentation fault (core dumped)
$=20

So you are saying that, with magic, the problem goes away on a 14 STABLE=20
machine and then returns everywhere else?

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-235751-21-REmWYbuHj3>