[Bug dynamic-link/34164] elf: IFUNC resolvers do not see static TLS initialization

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Tue Jun 2 18:42:18 GMT 2026


https://sourceware.org/bugzilla/show_bug.cgi?id=34164

--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Adhemerval Zanella
<azanella@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5879990337c1e37d3ded6bf6d03b8af9737a2d86

commit 5879990337c1e37d3ded6bf6d03b8af9737a2d86
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Jun 1 10:00:20 2026 -0300

    elf: Fix tst-ifunc-tls-init with --disable-default-pie

    The test failed with --disable-default-pie because its primary check read
    the resolver's diagnostic side effect before the resolver had run.

    In a non-PIE executable the references to the IFUNC (fptr and ifunc_tls)
    are satisfied through a canonical IPLT entry in the executable itself.
    Under the default lazy binding that IPLT is resolved on first use, not
    during startup relocation, so the resolver had not yet run when
    'check_sentinel' inspected that value.  With a PIE executable
    (or LD_BIND_NOW=1) the resolver runs eagerly at startup and the check
    passed.  The dlopen path was unaffected because dlopen resolves the
    data relocation eagerly.

    This is a test ordering issue: the resolver always reads the initial-exec
    TLS correctly whenever it runs, so the BZ 34164 fix is not involved.
    Reorder test_tls_ifunc so that fptr/ifunc_tls force the IFUNC to be
    resolved before the last_seen_sentinel value is inspected.

    Checked on x86_64-linux-gnu and i686-linux-gnu with --disable-default-pie.

    Reported-by: Yury Khrustalev <yury.khrustalev@arm.com>
    Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>

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


More information about the Glibc-bugs mailing list