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

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nick Alcock <n...@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7412b0a35c72921f9d84a2f6b07219f7cb6acd6d

commit 7412b0a35c72921f9d84a2f6b07219f7cb6acd6d
Author: Nick Alcock <nick.alc...@oracle.com>
Date:   Mon Sep 22 21:07:11 2025 +0100

    libctf: fix querying of large structures

    After GCC PR 121411 is fixed, large structures (with offsets > 512MiB)
    are written correctly... but libctf cannot query them properly unless
    they are even bigger (> 4GiB), because it checks to see if the ctt_size
    is CTF_LSIZE_SENT to decide whether to use a ctf_lmember_t or a
    ctf_member_t to encode the structure members.  But the structure member
    offsets are in *bits*, not bytes: the right value to check is
    CTF_LSTRUCT_THRESH, which is 1/8th the size.

    (Thanks to Martin Pirker <martin.pirk...@chello.at> for the diagnosis
    and fix.)

    Testing this is a bit fun, because we don't want to emit an error if the
    compiler is broken: but we cannot tell whether the compiler is broken
    using the existing lookup harness, because its input is passed through
    the linker (and thus the broken ld).  So add another sort of link mode,
    "objects", which keeps the constituent object files around and passes
    both the final linker output and the object files that make it up to the
    lookup program.  Our testcase can then check the linker input to see if
    the compiler is buggy, and only if it isn't check the linker output and
    fail if things aren't right.

    libctf/
            PR libctf/33339
            * ctf-types.c (ctf_struct_member): Check CTF_LSTRUCT_THRESH, not
            CTF_LSIZE_SENT.
            * testsuite/lib/ctf-lib.exp (run_lookup_test): New 'objects'
            link option.
            * testsuite/libctf-lookup/big-struct-corruption.*: New test.
            * testsuite/libctf-lookup/big-struct-ctf.c: New test input.

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

Reply via email to