public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug dynamic-link/31640] New: POWER10 ld.so crashes in elf_machine_load_address with GCC 14
Date: Sat, 13 Apr 2024 12:10:58 +0000	[thread overview]
Message-ID: <bug-31640-131@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 31640
           Summary: POWER10 ld.so crashes in elf_machine_load_address with
                    GCC 14
           Product: glibc
           Version: 2.40
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: fweimer at redhat dot com
          Reporter: fweimer at redhat dot com
                CC: bergner at linux dot ibm.com
  Target Milestone: ---
            Target: powerpc64le-linux-gnu

When built with GCC 14, ld.so crashes in elf_machine_load_address because the
current implementation assumes that r2 still has the kernel-provided value:

static inline Elf64_Addr
elf_machine_load_address (void)
{
  Elf64_Addr ret;

  /* The first entry in .got (and thus the first entry in .toc) is the
     link-time TOC_base, ie. r2.  So the difference between that and
     the current r2 set by the kernel is how far the shared lib has
     moved.  */
  asm ( "       ld      %0,-32768(2)\n"
        "       subf    %0,%0,2\n"
        : "=r"  (ret));
  return ret;
}

I don't think that's necessarily true in PCREL mode, so this is a glibc bug.

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

             reply	other threads:[~2024-04-13 12:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13 12:10 fweimer at redhat dot com [this message]
2024-04-13 12:11 ` [Bug dynamic-link/31640] " fweimer at redhat dot com
2024-04-14  9:50 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31640-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).