binutils/binutils-fix-abierrormsg.diff
Michael Matz f32da6f20f - Update to version 2.43:
* new .base64 pseudo-op, allowing base64 encoded data as strings
* Intel APX: add support for CFCMOV, CCMP, CTEST, zero-upper, NF
  (APX_F now fully supported)
* x86 Intel syntax now warns about more mnemonic suffixes
* macros and .irp/.irpc/.rept bodies can use \+ to get at number of times
  the macro/body was executed
* aarch64: support 'armv9.5-a' for -march, add support for LUT and LUT2
* s390: base register operand in D(X,B) and D(L,B) can now be omitted
  (ala 'D(X,)'); warn when register type doesn't match operand type
  (use option 'warn-regtype-mismatch=[strict|relaxed|no]' to adjust)
* riscv: support various extensions: Zacas, Zcmp, Zfbfmin, Zvfbfmin,
  Zvfbfwma, Smcsrind/Sscsrind, XCvMem, XCvBi, XCvElw, XSfCease, all at
  version 1.0;
  remove support for assembly of privileged spec 1.9.1 (linking support
  remains)
* arm: remove support for some old co-processors: Maverick and FPA
* mips: '--trap' now causes either trap or breakpoint instructions to
  be emitted as per current ISA, instead of always using trap insn
  and failing when current ISA was incompatible with that
* LoongArch: accept .option pseudo-op for fine-grained control
  of assembly code options; add support for DT_RELR
* readelf: now displays RELR relocations in full detail;
  add -j/--display-section to show just those section(s) content
  according to their type
* objdump/readelf now dump also .eh_frame_hdr (when present) when
  dumping .eh_frame
* gprofng: add event types for AMD Zen3/Zen4 and Intel Ice Lake processors;
  add minimal support for riscv
* linker:

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=471
2024-08-06 14:38:53 +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)
{