public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/60465] Compiling glibc-2.17,2.18 with gcc-4.8.2 and binutils-2.23.2,2.24 results in segfaults in _start / elf_get_dynamic_info
Date: Tue, 19 Aug 2014 22:02:00 -0000	[thread overview]
Message-ID: <bug-60465-4-egCS2z17H5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60465-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60465

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #27 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Thanks.  This seems to be a conjunction of several factors, the initial one
being that the 4.8+ compiler generates (e.g for the reduced testcase at -O):

        addl r14 = @ltoffx(_rtld_local#+15032385536), r1
        ;;
        ld8.mov r14 = [r14], _rtld_local#+15032385536

The huge number is not problematic per se, although it very likely runs afoul
of some limitation/quirk here, since the value loaded from the GOT is
truncated.

In fact it looks like the value loaded from the GOT is just the huge number,
that is to say the value of _rtld_local has been zeroed during the relocation.

This may come from _rtld_local being in the .sdata section, in which case there
is a relevant comment in sdata_symbolic_operand:

      /* Deny the stupid user trick of addressing outside the object.  Such
     things quickly result in GPREL22 relocation overflows.  Of course,
     they're also highly undefined.  From a pure pedant's point of view
     they deserve a slap on the wrist (such as provided by a relocation
     overflow), but that just leads to bugzilla noise.  */

In other words, the compiler skips the efficient @gprel relocation on purpose,
only to generate the @ltoffx relocation, which doesn't work either here...


      parent reply	other threads:[~2014-08-19 22:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-08 12:08 [Bug other/60465] New: " devurandom at gmx dot net
2014-03-08 12:09 ` [Bug other/60465] " devurandom at gmx dot net
2014-03-18  7:18 ` vapier at gentoo dot org
2014-03-18  7:29 ` devurandom at gmx dot net
2014-03-18 10:31 ` schwab@linux-m68k.org
2014-03-19  5:35 ` vapier at gentoo dot org
2014-03-25 18:23 ` devurandom at gmx dot net
2014-03-25 22:17 ` vapier at gentoo dot org
2014-03-25 23:01 ` devurandom at gmx dot net
2014-08-14  3:26 ` vapier at gentoo dot org
2014-08-14  7:13 ` ebotcazou at gcc dot gnu.org
2014-08-14  7:21 ` ebotcazou at gcc dot gnu.org
2014-08-14  7:35 ` pinskia at gcc dot gnu.org
2014-08-14 11:55 ` vapier at gentoo dot org
2014-08-14 11:57 ` vapier at gentoo dot org
2014-08-14 12:27 ` vapier at gentoo dot org
2014-08-16 14:22 ` vapier at gentoo dot org
2014-08-16 14:27 ` vapier at gentoo dot org
2014-08-16 14:28 ` vapier at gentoo dot org
2014-08-16 15:40 ` ebotcazou at gcc dot gnu.org
2014-08-18  7:58 ` rguenth at gcc dot gnu.org
2014-08-18 14:08 ` ebotcazou at gcc dot gnu.org
2014-08-18 21:14 ` ebotcazou at gcc dot gnu.org
2014-08-19  0:16 ` vapier at gentoo dot org
2014-08-19 21:46 ` ebotcazou at gcc dot gnu.org
2014-08-19 22:02 ` ebotcazou at gcc dot gnu.org [this message]

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-60465-4-egCS2z17H5@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).