public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug dynamic-link/14370] ld.so crashes on mismatched TLS/non-TLS symbols
Date: Tue, 04 Sep 2012 19:09:00 -0000	[thread overview]
Message-ID: <bug-14370-131-cPUzKJyPtI@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-14370-131@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=14370

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |hjl.tools at gmail dot com
         Resolution|INVALID                     |
            Summary|SIGFPE in 'ldd -r'          |ld.so crashes on mismatched
                   |                            |TLS/non-TLS symbols

--- Comment #15 from H.J. Lu <hjl.tools at gmail dot com> 2012-09-04 19:09:38 UTC ---
I don't think ld.so should crash on bad DSO built with the
old/bad glibc/binutils:

[hjl@gnu-6 pr14370]$ cat x.c
#if 0
#include <errno.h>
#else
int errno = 3;
#endif

int
bar (void)
{
  errno = 4;
  return errno;
}
[hjl@gnu-6 pr14370]$ cat main.c 
#include <stdio.h>
#include <dlfcn.h>

int
main ()
{
  void *handle;
  int (*func)();

  handle = dlopen ("./libfoo.so", RTLD_LAZY);

  if (!handle)
    {
      fprintf (stderr, "%s\n", dlerror());
      return 1;
    }

  func = dlsym (handle, "bar");
  if (func == NULL)
    {
      fprintf (stderr, "%s\n", dlerror());
      return 1;
    }

  printf ("errno: %d\n", func ());

  dlclose (handle);

  return 0;
}
[hjl@gnu-6 pr14370]$ make GLIBC-DIR= run.dynamic
gcc -m32    -c -o main.o main.c
gcc -m32 -o dynamic main.o -ldl
gcc -m32    -c -o x.o x.c
./ld -m elf_i386 -shared -o libfoo.so x.o -lm
./dynamic
make: *** [run.dynamic] Segmentation fault
[hjl@gnu-6 pr14370]$

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2012-09-04 19:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 10:05 [Bug dynamic-link/14370] New: SIGFPE in 'ldd -r' pluto at agmk dot net
2012-07-18 10:11 ` [Bug dynamic-link/14370] " aj at suse dot de
2012-07-18 10:49 ` pluto at agmk dot net
2012-07-18 10:54 ` jakub at redhat dot com
2012-07-18 11:00 ` pluto at agmk dot net
2012-07-18 12:37 ` pluto at agmk dot net
2012-07-24  2:04 ` carlos_odonell at mentor dot com
2012-07-24  6:14 ` pluto at agmk dot net
2012-09-02 20:00 ` hjl.tools at gmail dot com
2012-09-02 22:57 ` hjl.tools at gmail dot com
2012-09-03  2:54 ` bugdal at aerifal dot cx
2012-09-03 13:39 ` carlos_odonell at mentor dot com
2012-09-03 15:29 ` pluto at agmk dot net
2012-09-03 18:59 ` hjl.tools at gmail dot com
2012-09-03 20:07 ` aj at suse dot de
2012-09-04 19:09 ` hjl.tools at gmail dot com [this message]
2012-09-04 19:41 ` [Bug dynamic-link/14370] ld.so crashes on mismatched TLS/non-TLS symbols carlos_odonell at mentor dot com
2012-09-04 21:32 ` hjl.tools at gmail dot com
2012-09-04 22:03 ` carlos_odonell at mentor dot com
2012-09-04 22:15 ` bugdal at aerifal dot cx
2012-09-04 22:22 ` hjl.tools at gmail dot com
2012-09-04 23:26 ` bugdal at aerifal dot cx
2012-09-05 15:24 ` ppluzhnikov at google dot com
2012-09-05 15:30 ` hjl.tools at gmail dot com
2012-12-04  0:00 ` carlos at systemhalted dot org
2013-10-02 22:44 ` neleai at seznam dot cz
2014-06-17 18:59 ` fweimer at redhat dot com
2023-07-30 16:53 ` sam at gentoo dot org

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-14370-131-cPUzKJyPtI@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /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).