GCC Plugin: Do not use section groups with string notes.

Resolves: RHEL-21772
This commit is contained in:
Nick Clifton 2024-01-17 14:25:26 +00:00
parent 81629391ef
commit d5a6df7fb3
2 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,36 @@
--- annobin.orig/gcc-plugin/annobin.cc 2024-01-17 14:00:26.889983192 +0000
+++ annobin-12.31/gcc-plugin/annobin.cc 2024-01-17 14:01:27.517055850 +0000
@@ -3261,18 +3261,24 @@ plugin_init (struct plugin_name_args *
target_start_sym_bias = annobin_target_start_symbol_bias ();
if (annobin_attach_type == not_set)
{
- /* Choose a default attachment type. Link ordering is preferable
- as it is more resistant to changes in compiler section building.
- But it can only be used if the target assembler supports link_order sections
- and the target linker is sufficiently new that it implements them correctly.
- For now we use a test of the GCC version as an approximation to the binutils
- versions that are needed. (Note - 2.35.2, as used by RHEL-9, is insufficient).
- See BZ 2016458 for an example of where this solution is needed. */
+ if (annobin_note_format == string)
+ /* String format notes do not need section groups. */
+ annobin_attach_type = none;
+ else
+ {
+ /* Choose a default attachment type. Link ordering is preferable
+ as it is more resistant to changes in compiler section building.
+ But it can only be used if the target assembler supports link_order sections
+ and the target linker is sufficiently new that it implements them correctly.
+ For now we use a test of the GCC version as an approximation to the binutils
+ versions that are needed. (Note - 2.35.2, as used by RHEL-9, is insufficient).
+ See BZ 2016458 for an example of where this solution is needed. */
#if GCCPLUGIN_VERSION_MAJOR >= 12
- annobin_attach_type = link_order;
+ annobin_attach_type = link_order;
#else
- annobin_attach_type = group;
+ annobin_attach_type = group;
#endif
+ }
}
annobin_inform (INFORM_VERBOSE, "Attach mode: %s", attach_mode_name (annobin_attach_type));

View File

@ -2,7 +2,7 @@
Name: annobin Name: annobin
Summary: Annotate and examine compiled binary files Summary: Annotate and examine compiled binary files
Version: 12.31 Version: 12.31
Release: 1%{?dist} Release: 2%{?dist}
License: GPL-3.0-or-later AND LGPL-2.0-or-later AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND GFDL-1.3-or-later License: GPL-3.0-or-later AND LGPL-2.0-or-later AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND GFDL-1.3-or-later
# Maintainer: nickc@redhat.com # Maintainer: nickc@redhat.com
# Web Page: https://sourceware.org/annobin/ # Web Page: https://sourceware.org/annobin/
@ -62,7 +62,7 @@ Source: https://nickc.fedorapeople.org/%{annobin_sources}
%global annobin_source_dir %{_usrsrc}/annobin %global annobin_source_dir %{_usrsrc}/annobin
# Insert patches here, if needed. Eg: # Insert patches here, if needed. Eg:
# Patch01: annobin-foo.patch Patch01: annobin-strings-no-attach.patch
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -366,6 +366,9 @@ exit $res
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%changelog %changelog
* Wed Jan 17 2024 Nick Clifron <nickc@redhat.com> - 12.31-2
- GCC Plugin: Do not use section groups with string notes. (RHEL-21772)
* Wed Nov 15 2023 Nick Clifron <nickc@redhat.com> - 12.31-1 * Wed Nov 15 2023 Nick Clifron <nickc@redhat.com> - 12.31-1
- Update glibc detection heuristics for PPC64. (RHEL-16453) - Update glibc detection heuristics for PPC64. (RHEL-16453)
- Fix another atexit test failure. (#2247481) - Fix another atexit test failure. (#2247481)