public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/17078] New: error while loading shared libraries: unexpected reloc type 0x0d
@ 2014-06-23  2:18 macro@linux-mips.org
  2014-06-23  8:21 ` [Bug dynamic-link/17078] " fweimer at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: macro@linux-mips.org @ 2014-06-23  2:18 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-17 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-23  2:18 [Bug dynamic-link/17078] New: error while loading shared libraries: unexpected reloc type 0x0d macro@linux-mips.org
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

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).