public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Bug in dynamic linker ld 2.37.20211103-150100.7.29
@ 2022-06-10 19:38 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2022-06-10 19:38 UTC (permalink / raw)
  To: pierre.lauber, Jan Beulich, Binutils

commit 17c6c3b99156fe82c1e637e1a5fd9f163ac788c8
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri May 7 12:05:12 2021 +0200

    x86-64/ELF: clear src_mask for all reloc types

    x86-64 uses rela relocations. The comment next to the field's declaration
    says "Non-zero values for ELF USE_RELA targets should be viewed with
    suspicion ..." And indeed the fields being non-zero causes section
    contents to be accumulated into the final relocated values in addition to
    the relocations' addends, which is contrary to the ELF spec.

But for_main.o from

https://lists.gnu.org/archive/html/bug-binutils/2022-06/msg00064.html

has

  28: e8 fc ff ff ff        call   29 <main+0x29> 29: R_X86_64_PLT32
for_rtl_init_
  2d: e8 fc ff ff ff        call   2e <main+0x2e> 2e: R_X86_64_PLT32 MAIN__
  32: e8 fc ff ff ff        call   33 <main+0x33> 33: R_X86_64_PLT32
for_rtl_finish_

This is clearly wrong since addend is 0.  This is a bug in the
compiler which was
used to generate it.   If you have to use the buggy compiler, you need to use
binutils 2.36 or older.

-- 
H.J.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-10 19:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 19:38 Bug in dynamic linker ld 2.37.20211103-150100.7.29 H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).