binutils/binutils-fix-abierrormsg.diff
Michael Matz 7c6063bdba Accepting request 907786 from home:marxin:branches:devel:gcc
- Update to binutils 2.37:
  * The GNU Binutils sources now requires a C99 compiler and library to
    build.
  * Support for the arm-symbianelf format has been removed.
  * Support for Realm Management Extension (RME) for AArch64 has been
    added.
  * A new linker option '-z report-relative-reloc' for x86 ELF targets
    has been added to report dynamic relative relocations.
  * A new linker option '-z start-stop-gc' has been added to disable
    special treatment of __start_*/__stop_* references when
    --gc-sections.
  * A new linker options '-Bno-symbolic' has been added which will
    cancel the '-Bsymbolic' and '-Bsymbolic-functions' options.
  * The readelf tool has a new command line option which can be used to
    specify how the numeric values of symbols are reported.
    --sym-base=0|8|10|16 tells readelf to display the values in base 8,
    base 10 or base 16.  A sym base of 0 represents the default action
    of displaying values under 10000 in base 10 and values above that in
    base 16.
  * A new format has been added to the nm program.  Specifying
    '--format=just-symbols' (or just using -j) will tell the program to
    only display symbol names and nothing else.
  * A new command line option '--keep-section-symbols' has been added to
    objcopy and strip.  This stops the removal of unused section symbols
    when the file is copied.  Removing these symbols saves space, but
    sometimes they are needed by other tools.
  * The '--weaken', '--weaken-symbol' and '--weaken-symbols' options
    supported by objcopy now make undefined symbols weak on targets that
    support weak symbols. 
  * Readelf and objdump can now display and use the contents of .debug_sup

OBS-URL: https://build.opensuse.org/request/show/907786
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=363
2021-07-22 15:42:08 +00:00

44 lines
1.6 KiB
Diff

This fixes an error message given too eagerly on ppc64le,
when no input files are used and as-needed is in effect. E.g.:
% ld-new --as-needed -o /dev/null -lc
gives an error message about input and output ABI versions being
incompatible. This is because the ABI setting of "unknown" (0)
to "from-input" is done in ppc64_elf_before_check_relocs, which
isn't called for as-needed libraries (via check_directives callback).
merge_private_bfd_data is called for as-needed and not-as-needed inputs
(via notice_as_needed), so copy that code there.
This construct is used in some packages to check for availability
of libraries (e.g. in nvme-cli to check for -luuid). Redircting error
output makes this siletently fail.
Index: binutils-2.35/bfd/elf64-ppc.c
===================================================================
--- binutils-2.35.orig/bfd/elf64-ppc.c 2020-07-24 11:12:19.000000000 +0200
+++ binutils-2.35/bfd/elf64-ppc.c 2020-08-10 17:25:00.205219071 +0200
@@ -5310,11 +5310,17 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
if (iflags & ~EF_PPC64_ABI)
{
- _bfd_error_handler
- /* xgettext:c-format */
- (_("%pB uses unknown e_flags 0x%lx"), ibfd, iflags);
- bfd_set_error (bfd_error_bad_value);
- return false;
+ if (abiversion (info->output_bfd) == 0)
+ set_abiversion (info->output_bfd, abiversion (ibfd));
+ else
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB: ABI version %ld is not compatible with ABI version %ld output"),
+ ibfd, iflags, oflags);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
}
else if (iflags != oflags && iflags != 0)
{