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

--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <[email protected]>:

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

commit c1c4795df872f48b7f3659cae5974a6ae4f917ea
Author: H.J. Lu <[email protected]>
Date:   Thu Jul 2 07:02:48 2026 +0800

    readelf: Avoid may be used uninitialized warning from GCC 14

    GCC 14 fails to recognize that rel_entsz and entsz_name are unused when
    process_relocs returns early for error:

    .../binutils/readelf.c:10127:18: error: ârel_entszâ may be used
uninitialized [-Werror=maybe-uninitialized]
    10127 |               if (rel_entsz == 0)
          |                  ^
    ...
    .../binutils/readelf.c:10129:19: error: âentsz_nameâ may be used
uninitialized [-Werror=maybe-uninitialized]
    10129 |                   printf (_("<missing or corrupt dynamic tag:
%s>\n"),
          |                  
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    10130 |                           entsz_name);

    Clear them before returning error.  Also replace reltype_unknown with
    default since GCC 14 fails to see that reltype_unknown is the only
    unhandled value for relocation_type enum.

            PR binutils/34324
            * readelf.c (process_relocs): Clear rel_entsz and entsz_name
            before returning error on missing DT_REL and DT_RELA dynamic
            tags.

    Signed-off-by: H.J. Lu <[email protected]>

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

Reply via email to