public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "macro@linux-mips.org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug dynamic-link/17078] New: error while loading shared libraries: unexpected reloc type 0x0d
Date: Mon, 23 Jun 2014 02:18:00 -0000	[thread overview]
Message-ID: <bug-17078-131@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 17078
           Summary: error while loading shared libraries: unexpected reloc
                    type 0x0d
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: macro@linux-mips.org
                CC: macro@linux-mips.org
            Target: arm-linux-gnueabi

All the TLS test cases fail in the prelinker test suite when built with
the use of R_ARM_TLS_DESC relocations, that is with the
`-mtls-dialect=gnu2' GCC option in effect.  The following messages are
produced:

./tls1: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls1.sh
./tls2: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls2.sh
./tls3: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls3.sh
./tls4: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls4.sh
./tls5: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls5.sh
./tls6: error while loading shared libraries: unexpected reloc type 0x0d
FAIL: tls6.sh

The reason is the lack of handling for prelinked R_ARM_TLS_DESC
relocations in the dynamic linker.

Borrowing the testcase from bug #17075 it can also be reproduced as
follows:

$ cat libgetfoo.c
int __thread foo;

int
getfoo (void)
{
  return foo;
}
$ arm-linux-gnueabi-gcc -mtls-dialect=gnu2 -fPIC -shared
-Wl,-dynamic-linker,.../lib/ld-linux.so.3 -Wl,-rpath,.../lib -Wl,-rpath,$(pwd)
-o libgetfoo.so libgetfoo.c
$ cat getfoo.c
int getfoo (void);

int
main (void)
{
  return getfoo ();
}
$ arm-linux-gnueabi-gcc -mtls-dialect=gnu2
-Wl,-dynamic-linker,.../lib/ld-linux.so.3 -Wl,-rpath,.../lib -Wl,-rpath,$(pwd)
-o getfoo -L. -lgetfoo getfoo.c
$ ssh arm-host $(pwd)/getfoo
$ echo $?
0
$ echo .../lib > prelink.conf
$ echo $(pwd) >> prelink.conf
$ arm-linux-gnueabi-prelink -c ./prelink.conf -C ./prelink.cache
--ld-library-path=.../lib:$(pwd) --dynamic-linker=.../lib/ld-linux.so.3 -v
getfoo
Laying out 4 libraries in virtual address space 41000000-50000000
Assigned virtual address space slots for libraries:
.../lib/ld-linux.so.3 41000000-41028954
.../lib/libc.so.6 41030000-4116d588
.../lib/libgcc_s.so.1 41170000-4119832c
$(pwd)/libgetfoo.so 411a0000-411a8910
Prelinking .../lib/ld-2.19.90.so
Prelinking .../lib/libc-2.19.90.so
Prelinking .../lib/libgcc_s.so.1
Prelinking $(pwd)/libgetfoo.so
Prelinking $(pwd)/getfoo
$ ssh arm-host $(pwd)/getfoo
$(pwd)/getfoo: error while loading shared libraries: unexpected reloc type 0x0d
$ echo $?
127
$ 

I have substituted `...' for the sysroot path and $(pwd) for the CWD even
in output to avoid clutter.

The ARM TLS descriptor specification can be referred at bug #17075.

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


             reply	other threads:[~2014-06-23  2:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23  2:18 macro@linux-mips.org [this message]
2014-06-23  8:21 ` [Bug dynamic-link/17078] " fweimer at redhat dot com
2014-07-17 18:46 ` cvs-commit at gcc dot gnu.org
2014-07-17 18:49 ` macro@linux-mips.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-17078-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).